Confirmation when system shutdown on Openbox

Today I was installing openbox to my Linux Mint. I wanted to add a slot into obmenu called Exit to turn off the computer but asking me how:

Exit Message

The picture above is the result. The way I created is us trough gxmessage, an alternative to xmessage. This tool allows us to create little question boxes using gtk.

So I created abash script with (~/scripts/ having the following content:


gmessage "The system will be shut down. Are your sure?" -center -title "System Shutdown" -default "Cancel" -buttons "_Shut down":1,"_Reboot":2,"_Log out":3,"_Cancel":4 > /dev/null 

case $? in
        sudo shutdown -h now;;
        sudo shutdown -r now;;
        killall openbox;;
        echo "Exit";;

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: