Posted By

ktrout on 11/03/13


Tagged

prompt logout gmessage


Versions (?)

logout prompt launch dialog


 / Published in: Bash
 

launch a logout prompt using gmessage

  1. #!/bin/bash
  2.  
  3. gmessage "Are you sure you want to shut down your computer?" -center -title "Take action" -font "Sans bold 10" -default "Cancel" -buttons "_Cancel":1,"_Log out":2,"_Reboot":3,"_Shut down":4 >/dev/null
  4.  
  5. case $? in
  6. 1)
  7. echo "Exit";;
  8. 2)
  9. killall openbox;;
  10. 3)
  11. sudo shutdown -r now;;
  12. 4)
  13. sudo shutdown -h now;;
  14. esac

Report this snippet  

You need to login to post a comment.