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.

62 lines
838 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
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. hibernate
  29. reboot
  30. poweroff"
  31. # Open menu
  32. selection=$(printf '%s' "$items" | $DMENU)
  33. case $selection in
  34. restart)
  35. restart
  36. ;;
  37. logout)
  38. logout
  39. ;;
  40. hibernate)
  41. systemctl hibernate
  42. ;;
  43. suspend)
  44. systemctl suspend
  45. ;;
  46. reboot)
  47. systemctl reboot
  48. ;;
  49. halt|poweroff|shutdown)
  50. systemctl poweroff
  51. ;;
  52. esac
  53. exit