Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement]: Run graphical Applications as root #199

Open
1 task done
17Halbe opened this issue Jan 31, 2025 · 2 comments
Open
1 task done

[Enhancement]: Run graphical Applications as root #199

17Halbe opened this issue Jan 31, 2025 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@17Halbe
Copy link

17Halbe commented Jan 31, 2025

Already reported ? *

  • I have searched the existing open and closed request.

Description

GUI applications(e.g. GParted) which require root privileges don't open their graphical interface due to the fact that root can't access the users environment. In this specific case
XDG_RUNTIME_DIR
WAYLAND_DISPLAY
Sometimes sudo -E should work, but not consistently (depending on the call and app start sequence)
The most Wayland way to achieve this permanently is to add those variables to the sudoers env_keep directive.

This is related to #73
Reference Arch Wiki - Run GUI applications as root
man 5 sudoers

Proposed Solution

echo 'Defaults env_keep += "XDG_RUNTIME_DIR"
Defaults env_keep += "WAYLAND_DISPLAY"' | sudo tee /etc/sudoers.d/wayland

This command creates a wayland file in sudoers.d which adds those variables to the Command Environment(man 5 sudoers)

@17Halbe 17Halbe added the enhancement New feature or request label Jan 31, 2025
@JaKooLit
Copy link
Owner

thanks...

although you can just install xorg-xhost instead

@17Halbe
Copy link
Author

17Halbe commented Jan 31, 2025

That's true, I'd prefer 2 lines of text instead of an additional application plus remembering to add and remove root again from the access control list after app execution.
Your choice. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants