Polkit in i3

Over the pandemic I started using i3 a lot more. I use it as a separate session on my ubuntu box so I had to put together the backend myself. In the process of figuring out what i needed to do I learned about polkit. Once i realized why half my programs werent opening in i3, I was able to quickly fix it by adding

exec --no-startup-id /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 --exit-with-session i3

Well, I enjoy making little youtube videos and today I was doing a run through on how to setup polkit. But when I got to actually adding this line into the i3 config, I found out that ubuntu 20.04 doesnt seem to have the same gnome daemon setup! Now it has a different folder, /usr/lib/policykit-1, and its contents are polkitd and polkit-agent-helper-1. I’ve tried using both of those paths in my i3 config but neither seem to do the same thing as my old command.

Does anybody have an idea of how to implement polkit with this new setup?

With my openbox build lxsession has worked flawlessly as a polkit. It’s just /usr/bin/lxpolkit if you need to manually start it.

In Ubuntu 20 i’m seeing /usr/libexec/polkitd --nodebug in htop. That may be the way to go.

1 Like

I ended up using xfce-polkit with sway, there is a whole list of them here.

You may need to do which installed-polkit to verify the location it was installed too.
They can be started by your i3 config using the same line you were using for the gnome polkit

You could also look into doing things with xdg autostart / dex or systemd user services depending on how crazy you want to go.

1 Like