You are not logged in.

#1 2009-08-04 16:35:29

Dogs1985
Member
Registered: 2008-03-01
Posts: 201

[solved] how to shutdown in openbox?

i'm install fbsplash, slim, openbox. in openbox, how to set in menu let system shutdown or restart?

Last edited by Dogs1985 (2009-08-05 14:44:51)

Offline

#2 2009-08-04 17:05:41

pizmooz
Member
Registered: 2009-01-11
Posts: 21

Re: [solved] how to shutdown in openbox?

have a look at ~/.config/openbox/menu.xml

you'll need to insert something like:

<item label="shutdown">
  <action name="Execute">
    <command>shutdown -h now</command>
  </action>
</item>

similarly for reboot

Offline

#3 2009-08-04 17:19:07

sHyLoCk
Member
From: /dev/null
Registered: 2009-06-19
Posts: 1,197

Re: [solved] how to shutdown in openbox?

shutdown requires root privilege so unless you're logged in a root, I don't think the above method will work. Please correct me if I'm wrong.


~ Regards,
sHy
ArchBang: Yet another Distro for Allan to break.
Blog | GIT | Forum (。◕‿◕。)

Offline

#4 2009-08-04 17:29:46

Acecero
Member
Registered: 2008-06-21
Posts: 1,373

Re: [solved] how to shutdown in openbox?

You don't need to be logged in as root. You can always setuid or sudo it to make it work for the user.

http://wiki.archlinux.org/index.php/All … o_shutdown

Offline

#5 2009-08-04 18:51:59

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: [solved] how to shutdown in openbox?

You could also use staybox, a really small session manager for openbox. Can be found in the AUR.
Alternatively, please prefer the following commands over the above mentioned

dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Reboot

for reboot and

dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown

They work as user by default

Last edited by Army (2009-08-04 18:59:10)

Offline

#6 2009-08-04 20:35:08

Acecero
Member
Registered: 2008-06-21
Posts: 1,373

Re: [solved] how to shutdown in openbox?

Thank you Army, those commands work, but they also require this in the .xinitrc file for them to work as user.

exec ck-launch-session openbox-session

Offline

#7 2009-08-04 22:53:16

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: [solved] how to shutdown in openbox?

Yes that's right, but don't you have that in there anyway? ;-)

Offline

#8 2009-08-05 05:05:51

xd-0
Member
From: Sweden
Registered: 2007-11-02
Posts: 327
Website

Re: [solved] how to shutdown in openbox?

You should use these commands, the first for shurdown the second for reboot:

sudo shutdown -h now
sudo shutdown -r now

You must also edit /etc/sudoers so that your user or a group can run those commands without being prompted for password. Open /etc/issue and add this line (replace NAME with your username)

NAME  ALL=(ALL) NOPASSWD: /sbin/shutdown

Offline

Board footer

Powered by FluxBB