You are not logged in.
Pages: 1
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
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
Offline
You don't need to be logged in as root. You can always setuid or sudo it to make it work for the user.
Offline
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
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
Yes that's right, but don't you have that in there anyway? ;-)
Offline
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
Pages: 1