#!/bin/sh

if [ $# -lt 1 ] ; then
    echo "i3-quit logout | shutdown | reboot | show"
fi

case ${1} in
    logout)
        i3-msg exit
        ;;
    shutdown)
        # kdesu -c "systemctl poweroff"
	systemctl poweroff
        ;;
    reboot)
        # kdesu -c "systemctl restart"
	systemctl reboot
        ;;
    show)
        i3-nagbar -t warning -m 'How would you like to leave?' \
                  -b 'Exit i3'     'i3-quit logout'            \
                  -b 'Restart'     'i3-quit reboot'            \
                  -b 'Shutdown'    'i3-quit shutdown'
esac
