Sway: Question: How to launch root applications like gparted

Created on 24 Aug 2019  路  9Comments  路  Source: swaywm/sway

Hello. I wonder what's the most convenient way of running applications which need root priviliges under sway.

sudo gparted
[sudo] password for asbachb: 
No protocol specified
Unable to init server: Could not connect: Connection refused

(gpartedbin:1059): Gtk-WARNING **: 11:35:36.413: cannot open display: :0
gparted                                                                                                                                                  
localuser:root being added to access control list
Error executing command as another user: No authentication agent found.
localuser:root being removed from access control list

Most helpful comment

@asbachb: I use GNOME authentication agent to launch root applications.
In my ~/.config/sway/config:

exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1

All 9 comments

You could try gksu. Just an idea.
gksu <something> no idea if this tool is still being used.

Are you looking for them to just launch, or are you looking for a password dialog to prompt the opening of gparted?

The general issue is that programs running as root aren't allowed to show a GUI through Wayland. One workaround would be to run GParted in Xephyr, if it doesn't support PAM authentication.

(Closing since this isn't a Sway issue.)

@asbachb: I use GNOME authentication agent to launch root applications.
In my ~/.config/sway/config:

exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1

@asbachb: I use GNOME authentication agent to launch root applications.
In my ~/.config/sway/config:

exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1

Sorry for the late reply. But that was EXACTLY what I was looking for.

It is possible to run wayland apps as root under sway like so:

sudo env XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR gedit

Yet another way, if, for some reason, previous advices doesn't work for you:

ssh -X root@localhost
gparted

(obviously, it requires configured sshd with allowed root login and X forwarding)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Olie440 picture Olie440  路  4Comments

marcoms picture marcoms  路  3Comments

mcmfb picture mcmfb  路  3Comments

dnkl picture dnkl  路  4Comments

soymjolk picture soymjolk  路  3Comments