Advertisement
timcowchip

~/logout

Jan 12th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. ACTION=`zenity --width=90 --height=200 --list --radiolist --text="Select logout action" --title="Logout" --column "Choice" --column "Action" TRUE Shutdown FALSE Reboot FALSE Logout`
  4.  
  5. if [ -n "${ACTION}" ];then
  6. case $ACTION in
  7. Shutdown)
  8. zenity --question --text "Are you sure you want to halt?" && sudo /sbin/shutdown -h now
  9. ## or via ConsoleKit
  10. # dbus-send --system --dest=org.freedesktop.ConsoleKit.Manager \
  11. # /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
  12. ;;
  13. Reboot)
  14. zenity --question --text "Are you sure you want to reboot?" && sudo /sbin/reboot
  15. ## Or via ConsoleKit
  16. # dbus-send --system --dest=org.freedesktop.ConsoleKit.Manager \
  17. # /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
  18. ;;
  19. Logout)
  20. bspc quit 1 && pkill lemonbar && pkill conky && pkill thunderbird && pkill rssguard
  21. # Or gnome-screensaver-command -l
  22. ;;
  23. esac
  24. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement