Discussion:
[Fluxbox-users] shutdown menu item
Kete
2010-07-04 13:40:47 UTC
Permalink
Hello,
I put Shutdown in my menu and clicked on Reconfigure, but clicking on
Shutdown doesn't shut down the computer. I'm using xdm in Debian, and
here is my .fluxbox/menu:
[begin] (fluxbox)
[include] (/etc/X11/fluxbox/fluxbox-menu)
[exec] (Shutdown) { #!/bin/sh
gdmflexiserver -a -c 'SET_LOGOUT_ACTION HALT'
kill -TERM $(xprop -root _BLACKBOX_PID | awk '{print $3}') }
[end]
That's based on
http://fluxbox-wiki.org/index.php?title=Shutdown_computer_with_dialog I
also moved it to /etc/X11/fluxbox/fluxbox-menu and clicked Reconfigure,
but it still didn't work.
Kete
2010-07-04 15:01:04 UTC
Permalink
Post by Kete
I
also moved it
By "moved it", I meant the [exec] lines only.
Simon Bowden
2010-07-04 21:17:11 UTC
Permalink
You can't inline the script. The wiki is helping you make a shell script to
call from the menu.

You need to put the #!/bin/sh ... stuff in a file, make it executable, then
call that in your exec:

$ cat > ~/bin/my-shutdown.sh << EOF
#!/bin/sh
gdmflexiserver -a -c 'SET_LOGOUT_ACTION HALT'
kill -TERM $(xprop -root _BLACKBOX_PID | awk '{print $3}')
EOF
$ chmod +x ~/bin/my-shutdown.sh

Then [exec] (Shutdown) { ~/bin/my-shutdown.sh }

Cheers,

- Simon
Post by Kete
Hello,
I put Shutdown in my menu and clicked on Reconfigure, but clicking on
Shutdown doesn't shut down the computer. I'm using xdm in Debian, and
[begin] (fluxbox)
[include] (/etc/X11/fluxbox/fluxbox-menu)
[exec] (Shutdown) { #!/bin/sh
gdmflexiserver -a -c 'SET_LOGOUT_ACTION HALT'
kill -TERM $(xprop -root _BLACKBOX_PID | awk '{print $3}') }
[end]
That's based on
http://fluxbox-wiki.org/index.php?title=Shutdown_computer_with_dialog I
also moved it to /etc/X11/fluxbox/fluxbox-menu and clicked Reconfigure,
but it still didn't work.
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Fluxbox-users mailing list
https://lists.sourceforge.net/lists/listinfo/fluxbox-users
Javier Vasquez
2010-07-05 01:51:44 UTC
Permalink
Post by Simon Bowden
You can't inline the script. The wiki is helping you make a shell script to
call from the menu.
You need to put the #!/bin/sh ... stuff in a file, make it executable, then
$ cat > ~/bin/my-shutdown.sh << EOF
#!/bin/sh
gdmflexiserver -a -c 'SET_LOGOUT_ACTION HALT'
kill -TERM $(xprop -root _BLACKBOX_PID | awk '{print $3}')
EOF
$ chmod +x ~/bin/my-shutdown.sh
Then [exec] (Shutdown) { ~/bin/my-shutdown.sh }
Cheers,
- Simon
Post by Kete
Hello,
I put Shutdown in my menu and clicked on Reconfigure, but clicking on
Shutdown doesn't shut down the computer. I'm using xdm in Debian, and
[begin] (fluxbox)
[include] (/etc/X11/fluxbox/fluxbox-menu)
[exec] (Shutdown) { #!/bin/sh
gdmflexiserver -a -c 'SET_LOGOUT_ACTION HALT'
kill -TERM $(xprop -root _BLACKBOX_PID | awk '{print $3}') }
[end]
That's based on
http://fluxbox-wiki.org/index.php?title=Shutdown_computer_with_dialog I
also moved it to /etc/X11/fluxbox/fluxbox-menu and clicked Reconfigure,
but it still didn't work.
It's been years that I use the following:

[submenu] (Exit-Menu) {}
[exec] (Lock) {xlock}
[exit] (Logout)
! [exec] (Suspend-Disk) {sudo ifdown eth0 && sudo
acpitool -S && sudo ifup eth0}
[exec] (Suspend-Disk) {sudo swapoff -a && sudo swapon
-a && sudo acpitool -S}
[exec] (Suspend-Mem) {sudo acpitool -s}
! [exec] (Reboot) {sudo reboot}
[exec] (Reboot) {sudo shutdown -r now "Sutdown:
Rebooting now..."}
! [exec] (Shutdown) {sudo halt}
[exec] (Shutdown) {sudo shutdown -h -P now "Shutdown:
Shuting down now..."}
[end]

Of course I have reboot, halt and shutdown as entries in /etc/sudoers
for me so I don't have to provide password, :-)
--
Javier.
Loading...