You are not logged in.
Pages: 1
TL:DR
Using "exec dbus-run-session awesome" and launching polkit-agent in rc.lua "fixes missing functionality".
Hello everyone,
starting awesome wm with simply "exec awesome" in your .xinitrc leaves you with two key features missing that people might want to use, namely d-bus + xdg-desktop-portal. (for example opening a file picker from steam), and polkit (not being able to authenticate with GUI pop-ups).
I know launching awesome from a Login Manager (or Display Manager) should solve these issues.
Honestly until recently (chatgpt) i never fully understood why this would not work out of the box if you startx from tty and the wiki page doesnt really help users in that regard.
Instead of "exec awesome" you need "exec dbus-run-session awesome" for xdg-desktop-portal to work.
Adding awful.spawn.with_shell("/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &") to your rc.lua fixes the polkit pop-ups.
Im hesitant to add this to the wiki for obvious reasons (its not really part of awesome itself and etc).
Last edited by halimbo (2025-12-20 22:35:52)
Offline
dbus-run-session is not necessary for systemd as systemd already autostarts a bus for you
see https://archlinux.org/news/d-bus-now-la … ser-buses/
also in .xinitrc you're supposed to be executing some scripts located in /etc/X11/xinit/xinitrc.d/
see also https://wiki.archlinux.org/title/Xinit#xinitrc
Last edited by system72 (2025-12-20 22:11:14)
Offline
including the script /etc/X11/xinit/xinitrc.d/50-systemd-user.sh in ~/.xinitrc fixes the dbus issue.
thanks a lot for the clarification and help.
dbus-run-session is not necessary for systemd as systemd already autostarts a bus for you
but systemd itself does not "autostart" dbus unless you include that script. the xinit wiki does mention though that it's required for basic functionality.
Offline
but systemd itself does not "autostart" dbus unless you include that script.
no, the bus is started at login
Offline
Okay then how do you explain that the file picker (xdg-desktop-portal relying on dbus if i understand it correctly) only works if you include the script or run awesome with dbus-run-session?
I tested it on/off multiple times and it only works with those 2 methods.
Offline
the link says:
DISPLAY is used by any X application to know which display to use and XAUTHORITY to provide a path to the user's .Xauthority file and thus the cookie needed to access the X server. If you plan on launching X applications from systemd units, these variables need to be set. systemd provides a script in /etc/X11/xinit/xinitrc.d/50-systemd-user.sh to import those variables into the systemd user session on X launch. So unless you start X in a nonstandard way, user services should be aware of the DISPLAY and XAUTHORITY.
this means anything launched as a systemd service cannot communicate with the xorg display server due to the environment variables not being within systemds scope i.e. imported
Offline
Long story short, you should include /etc/X11/xinit/xinitrc.d/50-systemd-user.sh in your .xinitrc if you want xdg-desktop-portal to work with awesomeWM (without Display Manager).
You pointed this out yourself. It is not redundant because the script ist not "autograbbed" by simply going tty + startx +exec awesome.
https://github.com/systemd/systemd/blob/v219/NEWS#L194
* An X11 session scriptlet is now shipped that uploads
$DISPLAY and $XAUTHORITY into the environment of the systemd
--user daemon if a session begins. This should improve
compatibility with X11 enabled applications run as systemd
user services.
EDIT: I understand now what you meant...D-Bus is launched automatically but the script is not.
Last edited by halimbo (2025-12-20 23:22:55)
Offline
the script contains this line:
if command -v dbus-update-activation-environment >/dev/null 2>&1; then
dbus-update-activation-environment DISPLAY XAUTHORITY
fiwhich does the following according to dbus's man page:
dbus-update-activation-environment updates the list of environment variables used by dbus-daemon --session when it activates session services without using systemd.
allows for anything communicating over dbus to see the environment variables, when you run dbus-run-session manually it starts that process as a new session which presumably contains the environment variables already without the need to import them
Offline
Pages: 1