How to run gparted under sway?

I am trying to use sway under Silverblue. My environment is created like this:
Start from Silverblue 33, fully upgrade, reboot
sudo rpm-ostree install sway gparted
sudo systemctl set-default multi-user.target
reboot
Login, then run sway

Now:

  1. If I press Super-D, search for gparted and run, no response

  2. Open a terminal by Super-Enter,
    $ 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

  3. now try with sudo gparted
    $ sudo gparted
    No protocol specified
    Unable to init server: Could not connect: Connection refused

    (gpartedbin:10765): Gtk-WARNING **: 05:07:22.942: cannot open display: :1

Do you have a polkit agent running? It works fine on regular Fedora 33 with sway. If I kill the polkit agent, I get the same error as above.

2 Likes

What I changed is to stop graphical.target from auto loading.
Then login to text mode, then run sway.

I am not sure polkit agent still running in my case or not.

How can I check?

GNOME session has its own agent and it starts automatically when you login to GNOME. You probably don’t have a polkit agent atm, you need to install one and start it manually when you log in. There are various way to start programs, e.g. you can start it from the sway’s configuration file:

exec lxpolkit

Change lxpolkit with your desired agent. You need to specify full path if it is not in your PATH.

3 Likes

I have find some example to start gnome’s agent, like:

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

After adjust the path to:
/usr/lib/polkit-1/polkit-agent-helper-1

It is still the same.

I will use Gnome for tasks that I cannot do in sway while learning how to fix that.

1 Like

It believe gnome-shell now runs it’s own polkit agent internally. (someone please correct this if it’s wrong)

You’ll need install another agent for sway. lxpolkit (already mentioned) and xfce-polkit both work.

4 Likes

Thank you very much!

I install lxpolkit and add the line exec lxpolkit to ~/.config/sway/config

then I just run
gparted

I now got the prompt to enter password to gain enough right for gparted!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.