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.

54 lines
760 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
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. # Logout function
  14. logout() {
  15. pkill dwm
  16. }
  17. # Load dmenu config
  18. # shellcheck source=/dev/null
  19. [ -f "$HOME/.dmenurc" ] && . "$HOME/.dmenurc" || DMENU='dmenu -z 1900 -x 10 -y 10 -i'
  20. # Menu items
  21. items="logout
  22. suspend
  23. hibernate
  24. reboot
  25. poweroff"
  26. # Open menu
  27. selection=$(printf '%s' "$items" | $DMENU)
  28. case $selection in
  29. logout)
  30. logout
  31. ;;
  32. hibernate)
  33. loginctl hibernate
  34. ;;
  35. suspend)
  36. sudo /sbin/sleep
  37. ;;
  38. reboot)
  39. sudo /sbin/reboot
  40. ;;
  41. halt|poweroff|shutdown)
  42. sudo /sbin/shutdown
  43. ;;
  44. esac
  45. exit