the stuff

heads-shutdown-menu 862B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. #
  3. # Copyright (c) 2016-2018 Ivan J. <parazyd@dyne.org>
  4. # See LICENSE file for copyright and license details.
  5. #
  6. # a rude shutdown menu
  7. watdo="$(yad --list \
  8. --title="Shutdown" \
  9. --center \
  10. --width=300 \
  11. --height=180 \
  12. --separator=" & " \
  13. --print-column=1 \
  14. --column="Action" --column="Description" \
  15. "shutdown" "perform a system shutdown" \
  16. "reboot" "perform a system reboot" \
  17. "suspend" "suspend to ram")"
  18. watdo="$(echo $watdo | cut -d' ' -f1)"
  19. case "$watdo" in
  20. shutdown)
  21. yad \
  22. --info \
  23. --wrap \
  24. --center \
  25. --text="Will shut down after you click OK."
  26. [ $? = 0 ] && exec sup heads-init shutdown
  27. ;;
  28. reboot)
  29. yad \
  30. --info \
  31. --wrap \
  32. --center \
  33. --text="Will shut down after you click OK."
  34. [ $? = 0 ] && exec sup heads-init reboot
  35. ;;
  36. suspend)
  37. exec sudo /usr/sbin/pm-suspend
  38. ;;
  39. *)
  40. exit 0
  41. ;;
  42. esac