i3-quit 534 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. if [ $# -lt 1 ] ; then
  3. echo "i3-quit logout | shutdown | reboot | show"
  4. fi
  5. case ${1} in
  6. logout)
  7. i3-msg exit
  8. ;;
  9. shutdown)
  10. kdesu -c "systemctl poweroff"
  11. ;;
  12. reboot)
  13. kdesu -c "systemctl restart"
  14. ;;
  15. show)
  16. i3-nagbar -t warning -m 'How would you like to leave?' \
  17. -b 'Exit i3' 'i3-quit logout' \
  18. -b 'Restart' 'i3-quit reboot' \
  19. -b 'Shutdown' 'i3-quit shutdown'
  20. esac