logout prompt launch dialog


/ Published in: Bash
Save to your folder(s)

launch a logout prompt using gmessage


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.