You are not logged in.
Pages: 1
Topic closed
I am having a problem using polkit with the wlroots based compositors: Sway, Wayfire and Labwc
I have Gnome installed, where it works without problems.
Following the wiki, I also installed polkit-gnome and added it to the relevant autostart files
Grepping ps aux, the authentication agent is running
=$ ps aux | grep polkit
polkitd 569 0.0 0.1 2716340 23604 ? Ssl 03:40 0:00 /usr/lib/polkit-1/polkitd --no-debug
stupidme 589 0.1 0.2 610756 42792 tty1 Sl+ 03:40 0:01 /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
stupidme 19962 0.0 0.0 6496 2500 pts/0 S+ 04:01 0:00 grep --color=auto polkit
=$
When I try to start a GUI requiring elevated priveledges, eg gparted or grub-customizer, I get prompted for my password but authentification then fails with.
=$ gparted
Authorization required, but no authorization protocol specified
Unable to init server: Could not connect: Connection refused
(gpartedbin:19308): Gtk-WARNING **: 04:00:19.863: cannot open display: :0
=$
=$ grub-customizer
sh: line 1: xhost: command not found
Authorization required, but no authorization protocol specified
Unable to init server: Could not connect: Connection refused
(grub-customizer:18756): Gtk-WARNING **: 03:59:50.385: cannot open display: :0
sh: line 1: xhost: command not found
=$
Does anyone have any idea what I am missing?
Irvine
By the way, it may or may not be relevant, but the exec lines for the various compositors are:
case "$Key" in
"g") echo -e "${Dimd}Okay, Starting Gnome${End}"
Throbber
MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland exec dbus-run-session gnome-session ;;
"s") echo -e "${Dimd}Okay, Starting Sway${End}"
Throbber
MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland exec sway ;;
"f") echo -e "${Dimd}Okay, Starting Wayfire${End}"
Throbber
MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland exec wayfire ;;
"l") echo -e "${Dimd}Okay, Starting LabWc${End}"
Throbber
MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland exec labwc ;;
*) echo -e "${Dimd}Okay, launching a plain console${End}"
echo ;;
esac
I tried adding
exec dbus-run-session <wlroots compositor>
But it broke nwg-menu and/or nwg-panel
Last edited by IrvineHimself (2021-10-21 17:13:59)
Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!
Offline
sh: line 1: xhost: command not found
…
cannot open display: :0
wlroots based compositors
The stuff tries to use xwayland - even if you have it installed, I'm not sure whther it plays ball w/ polkit.
Grub customizer tries to open the display using https://archlinux.org/packages/extra/x86_64/xorg-xhost/ - which you don't have.
Offline
After scrutinizing package dependencies I noticed that although grub-customizer, the one that complained about the missing xorg-xhost, doesn't list it as dependency, (optional or otherwise,) gparted does list xorg-xhost as an opt depend.
After installing xorg-xhost, both packages work fine with polkit. (I will file a bug report for grub-customizer about the missing opt depend.)
I actually tried installing xorg-xhost before posting, but I was experimenting with a variety of agents, (eg polkit-dumb-agent-git,)at the time. So, there could be a number of reasons why it initially didn't work for me.
It's kind of bizarre actually, gnome-shell on wayland doesn't require xorg-xhost for polkit to elevate privileges. Although I suspect this is probably something to do with mutter running on xwayland
For reference, in case google points to this post, neither package lists xorg-xwayland as a dependency, (optional or otherwise.)
Thanks for your help
Irvine
Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!
Offline
Mutter is gnomes wayland compositor.
You could check whether those clients on gnome run on xwayland or use the wayland backend.
Might relate to session type or some other environment variable then.
Offline
I was having the same problem in sway despite already having xorg-xhost installed.
I managed to solve it by running
xhost + local:
as a normal user following this answer.
Edit: Follow BBCode
Last edited by artemis7107 (2022-12-15 22:05:35)
Offline
Please do not necrobump (as you have previously been asked).
https://wiki.archlinux.org/title/Genera … bumping%22
Closing.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Pages: 1
Topic closed