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/openbox_logour.sh) having the following content:

#!/bin/bash

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
    1)
        sudo shutdown -h now;;
    2)
        sudo shutdown -r now;;
    3)
        killall openbox;;
    4)
        echo "Exit";;
esac
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: