You are not logged in.

#1 2011-04-27 09:02:00

awayand
Member
Registered: 2009-09-25
Posts: 398

[SOLVED] newbie guide for policy kit on arch?

Hi,
I am trying to add a feature to openbox that allows me to select "reboot" in my open session.
I think the most "elegant" solution would be to use policykit.

I installed consolekit and polkit.
I added

exec ck-launch-session openbox-session

to my ~/.xinitrc.
When I am in an openbox session, simply issuing a reboot from a terminal doesn't work.

I have looked through the wiki, the arch bbs (don't want to use the sudo example), google, etc., but none of the polkit documentation I could find was really helpful. Where could I find a decent newbie tutorial on policy kit with examples to work through?

Thanks!

Last edited by awayand (2011-04-28 02:42:27)

Offline

#2 2011-04-27 09:26:01

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: [SOLVED] newbie guide for policy kit on arch?

reboot

dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart

shutdown

dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop

Offline

#3 2011-04-28 02:25:23

awayand
Member
Registered: 2009-09-25
Posts: 398

Re: [SOLVED] newbie guide for policy kit on arch?

Hello JokerBoy,
thanks for your prompt reply. If I understood correctly:

dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart

send a message to the systemwide message bus,
show the reply,
send the message to connection name "org.freedesktop.ConsoleKit" provided by some client program on the systemwide message bus(how do I find out which program is providing this connection name or confirm that this is indeed provided by ConsoleKit?),
send the message to the object "/org/freedesktop/ConsoleKit/Manager" within the connection name above,
send the message to the method "Restart" defined in the "org.freedesktop.ConsoleKit.Manager" interface.

Are you implying I should execute the above command in my terminal? Wouldn't I have to put this into a configuration file somewhere?

Thanks for your help!

EDIT: Ok, I understand now. After invoking openbox with ck-launch-session I can use the above commands so I just need to put these as "shortcuts" into my menu and done.

Last edited by awayand (2011-04-28 02:34:39)

Offline

Board footer

Powered by FluxBB