#!/bin/bash gmessage "Have a nice day ~" -center -title "Take action" -font "Sans bold 10" -default "Cancel" -buttons "_Cancel":1,"_Log out":2,"_Reboot":3,"_Shut down":4 >/dev/null case $? in 1) echo "Exit";; 2) killall openbox;; 3) shutdown -r now;; 4) shutdown -h now;; esac #By adding suid mode to shutdown command, you are allowing regular user to run shutdown command as root: sudo chmod u+s /sbin/shutdown