Hi @Seventh, I wanted to point this way you mentioned below is exactly the same as using sudo XD (or even worse from a security point of view)
Conceptually, there’s no reason for not using sudo to run GUI application, if you pay attention and are VERY responsible; likewise, there’s would be no technical reason to prefer
su for desktop, single user usage, if you were very responsible.
The practical reason for not to using sudo in GUI instead, is that you tend to forget about having launched the application with root privileges, and could seriously harm your system in case, for instance, unwantedly deleted system folders.
Anyway, for the next time, there are also 2 other easier ways of doing this:
using doas(1), the OpenBSD alternative to sudo, easier to manage, especially when trying to grant some user application a root privilege. It’s been pprted to Linux as opendoas (also in void repo). For example, to be able to execute
/sbin/poweroff as root, touch and edit a
/etc/doas.conf file with the following content:
permit nopass keepenv <username> as root cmd /sbin/poweroff
This will grant you the possibility to use /sbin/poweroff as you were root, without any need of typing
sudo, without a password, keepenv the your standard user’s environmental variables. See doas.conf(1)
creating a couple of aliases in your shell configuration file,like:
alias poweroff sudo /sbin/poweroff