You are not logged in.
I can't open Thunar by typing "doas thunar" on the terminal. I've figured out that i can just use "pkexec thunar", but i just wanted to know why this happens, since i can't seem to find it anywhere in the wiki. Thanks in advance!
Offline
sudo and I'm assuming doas as well discards a lot of the environment of the calling user for security purposes. In this case you'll want to retain DISPLAY and DBUS_SESSION_BUS_ADDRESS at the least, sudo would have a -E flag to keep the environment not sure about doas. In any case running GUI applications as root is often not that good of an idea, and afaik thunar can use gvfs which has the admin:// special file URL that wraps the actual operations in polkit rather than running the entire process as root.
Offline
As V1del pointed out, we need to retain the DISPLAY and DBUS_SESSION_BUS_ADDRESS environment variables.
This is possible with doas by changing the /etc/doas.conf to include the "keepenv" option.
https://man.openbsd.org/doas.conf.5#keepenv
So, for example, if the user is part of the wheel group, you can add something like this to your doas.conf...
permit keepenv :wheel
(To edit /etc/doas.conf you will need to be a root user btw)
Of course, if you only want to inherit the environment variables you need for "doas thunar" to work, you could use the "setenv" option instead.
https://man.openbsd.org/doas.conf.5#setenv
Last edited by RoseMaster3000 (2021-11-10 12:48:51)
Offline