Author Topic: Adding a true End Session button to openbox  (Read 2034 times)

whit

  • Full Member
  • ***
  • Posts: 145
    • View Profile
Adding a true End Session button to openbox
« on: June 08, 2004, 09:22:35 pm »
As a shortcut to get out of openbox, in /usr/bin I created a file called mb-applet-kill-wrapper.sh with the contents:

Code: [Select]
#!/bin/sh



exec /bin/killall openbox


I matched its perms to the other mb-applet programs, then in a term I typed

Code: [Select]
mb-applet-launcher -o -1 -l exit.png mb-applet-kill-wrapper.sh

which immediately added the icon to the bar. Then pressing that exits openbox, which will remember it was there and have it there on next startx.

To get rid of it, do a \"ps x\" in an X term, note its process number on the left, then \"kill xxxx\" where xxxx is the process number. If you exit now (with \"killall openbox\" for instance) it will be gone on next startup. Same thing can be done to remove/add other items - the clock for instance.

Note this is a dangerous button, in that it just exits - no asking if you really want to. But I find it useful just the same, since there are times where it\'s easier to work without X (or safer - when running something like the ntpdate binary that crashes it).

ikm

  • Full Member
  • ***
  • Posts: 172
    • View Profile
    • http://
Adding a true End Session button to openbox
« Reply #1 on: June 09, 2004, 05:08:25 am »
Quote
As a shortcut to get out of openbox, in /usr/bin I created a file called mb-applet-kill-wrapper.sh with the contents:

[...]

Note this is a dangerous button, in that it just exits - no asking if you really want to.


You can use xmessage from your script to ask for a confirmation, something like \'xmessage -buttons Yes:1,No:2 \"Would you like to exit X?\"\'

whit

  • Full Member
  • ***
  • Posts: 145
    • View Profile
Adding a true End Session button to openbox
« Reply #2 on: June 09, 2004, 10:28:05 am »
Thanks. That\'s what I was looking for! So we get:

Code: [Select]
#!/bin/sh



#

# Kill openbox?

#

 

doit=`xmessage -center -print -buttons Yes,No Exit X?`



if [ $doit = Yes ]; then

  exec /bin/killall openbox

fi