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 \
  4. -title "Take action" -font "Sans bold 10" -default "Cancel" \
  5. -buttons "_Cancel":1,"_Log out":2,"_Reboot":3,"_Shut down":4 >/dev/null
  6.  
  7. case $? in
  8. 1)
  9. echo "Exit";;
  10. 2)
  11. killall openbox;;
  12. 3)
  13. sudo shutdown -r now;;
  14. 4)
  15. sudo shutdown -h now;;
  16. esac

Report this snippet  

You need to login to post a comment.