11

I use i3wm (www.i3wm.org) as the window manager for ubuntu 11.10 x64.

it seems that whatever piece of magic that controls elevation is not functioning properly. It's not an issue with i3wm perse, but rather something provided by gnome and unity that im missing, and need to implement manually.

example:

in unity, if i run software center, i am prompted for my admin password, and everything works as expected. in i3wm, running software center does not prompt, and thus i cant install anything. (unless i do sudo software-center from the CLI)

is there some process / application i should be using to have apps ask for admin passwords when required?

it'd be great to get that bit of functionality in i3.

1
  • Is this still unanswered?
    – mloskot
    Jun 8, 2012 at 9:23

3 Answers 3

9

Elevation uses several components:

  • the program must be running in a ConsoleKit or systemd-logind session – ideally, all of your X11 programs should be in the same session.

    If your distribution uses systemd, run loginctl show-session "$XDG_SESSION_ID" and look for "State=active".

    Otherwise, run ck-list-sessions and verify that it shows your X11 session as both "local = TRUE" and "active = TRUE".

  • the session must have a PolicyKit agent – this is the piece of software that displays elevation prompts.

    Run /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 and see if it helps.

To test elevation, you can use pkexec /bin/sh or pkaction.

4
  • :) adam@wtfhax:~$ /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 (polkit-gnome-authentication-agent-1:9795): polkit-gnome-1-WARNING **: Failed to register client: The name org.gnome.SessionManager was not provided by any .service files
    – user107049
    Feb 13, 2012 at 17:00
  • ah, that works just fine actually. i tried doing some administrative stuff while that command was running, and was prompted as expected. adding /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 to my xinitrc solved the problem permanently :) thank you!
    – user107049
    Feb 13, 2012 at 17:52
  • @adam: Be careful with adding stuff to xinitrc like that. It is best when all programs run inside the same CK session, including the agents. Feb 13, 2012 at 18:02
  • 3
    i actually thought about that, and added it to the .i3/config file, and had it run at login.
    – user107049
    Feb 13, 2012 at 20:56
1

AFAIK, privilege elevation has nothing to do with the window manager. Use gksudo for GUI apps that require root privileges.

For example:

gksudo synaptic &
3
  • that much makes sense, but i3wm has a nice launcher (mod+d) that i use to fire up software, and afaik, i cant modify it to call things in such a way.
    – user107049
    Feb 13, 2012 at 16:57
  • I highly doubt you can't modify it, specially if it's open source. And if you can't modify how software is launched, it's horrible. Even Windows allows that...
    – m0skit0
    Feb 13, 2012 at 18:57
  • 3
    @adam mod+d and then type in gksudo synaptic hit ENTER and you'll be prompted for password. All works like charm.
    – mloskot
    Mar 13, 2013 at 23:49
0

A more recent answer could be to install lxpolkit.

sudo apt-get install lxpolkit

And then add the following to your ~/.config/i3/config:

exec --no-startup-id lxpolkit

A similar approach may work with other authentication agents listed here https://wiki.archlinux.org/title/Polkit#Authentication_agents

source: https://www.reddit.com/r/i3wm/comments/chjnng/how_do_i_fix_authentication_agent_in_i3wm/

You must log in to answer this question.