My path to achieve the greatest Linux desktop ever :)

Rebooting and Shutting Down on Openbox

Probably the biggest setback for me when I changed to Openbox was the lack of Power Off Commands such as Shutting Down and Rebooting (and suspending as well but I haven’t really solved that one yet). So I’ll share how I solved the problem in my case.

Edit: Suspend and Hibernate added ^^

Edit 2: code changed by wordpress so the original is here.

Even before these steps, make sure you have dbus, upower and consolekit installed (sudo pacman -S dbus upower consolekit).

Also make sure to have this line in your xinitrc file:

exec ck-launch-session dbus-launch openbox-session

(Example)

Now, let’s go edit the menu and add the entries…

1) Open OBmenu

2) Add an item under the Openbox 3 section

3) Name it to Shut Down or whatever you prefer

4) Action is Execute and command is this:

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

5) We’re now done with the shutting down part, let’s go for the reboot

6) Repeat step 2 and name the item to Reboot or whatever fits your needs

7) Action is Execute and command is:

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

8) Repeat step 2 and name the item to Suspend or whatever you think suits you best

9) Action is Execute and command is:

dbus-send –system –print-reply –dest=”org.freedesktop.UPower” /org/freedesktop/UPower org.freedesktop.UPower.Suspend

10) Step 2 again and the item is Hibernate

11) Action is Execute and command is:

dbus-send –system –print-reply –dest=”org.freedesktop.UPower” /org/freedesktop/UPower org.freedesktop.UPower.Hibernate

12) Save, reconfigure Openbox (just in case) and you’re all set ^^

Advertisements

One response

  1. I noticed now that worpress hates me and turns — into – so I’ll leave the corrections here:

    Shutting Down:
    dbus-send –system –print-reply –dest=”org.freedesktop.ConsoleKit” /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop

    Rebooting:
    dbus-send –system –print-reply –dest=”org.freedesktop.ConsoleKit” /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart

    Suspending:
    dbus-send –system –print-reply –dest=”org.freedesktop.UPower” /org/freedesktop/UPower org.freedesktop.UPower.Suspend

    Hibernating:
    dbus-send –system –print-reply –dest=”org.freedesktop.UPower” /org/freedesktop/UPower org.freedesktop.UPower.Hibernate

    Edit: it also changes in the comments so I’ll be posting the correct code soon… the double – are before system, print and dest if it helps for now… :s

    November 18, 2011 at 10:04

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s