Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
815 B

4 years ago
  1. #!/bin/sh
  2. # Set environment
  3. export BSPWM_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/bspwm"
  4. # Function to kill programs
  5. killprogs() {
  6. # Kill udisks-glue
  7. pkill -x udisks-glue
  8. # Kill panel
  9. pkill -x panel
  10. # Kill Redshift
  11. pkill -x redshift
  12. }
  13. # Restart function
  14. # shellcheck source=/dev/null
  15. restart() {
  16. reboot
  17. }
  18. # Logout function
  19. logout() {
  20. pkill dwm
  21. }
  22. # Load dmenu config
  23. # shellcheck source=/dev/null
  24. [ -f "$HOME/.dmenurc" ] && . "$HOME/.dmenurc" || DMENU='dmenu -i'
  25. # Menu items
  26. items="logout
  27. suspend
  28. reboot
  29. poweroff"
  30. # Open menu
  31. selection=$(printf '%s' "$items" | $DMENU)
  32. case $selection in
  33. restart)
  34. restart
  35. ;;
  36. logout)
  37. logout
  38. ;;
  39. hibernate)
  40. systemctl hibernate
  41. ;;
  42. suspend)
  43. systemctl suspend
  44. ;;
  45. reboot)
  46. reboot
  47. ;;
  48. halt|poweroff|shutdown)
  49. shutdown -h now
  50. ;;
  51. esac
  52. exit