powermenu 554 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. powermenu() {
  3. options=" Poweroff\n Reboot\n󰤄 Suspend\n Hibernate\n󰍃 Logout\n Lock"
  4. selected=$(echo "$options" | dmenu -i -p "Session:" )
  5. if [ "$selected" = " Poweroff" ]; then
  6. loginctl poweroff
  7. elif [ "$selected" = " Reboot" ]; then
  8. loginctl reboot
  9. elif [ "$selected" = "󰤄 Suspend" ]; then
  10. loginctl suspend
  11. elif [ "$selected" = " Hibernate" ]; then
  12. loginctl hibernate
  13. elif [ "$selected" = "󰍃 Logout" ]; then
  14. pkill dwm
  15. elif [ "$selected" = " Lock" ]; then
  16. slock
  17. return
  18. fi
  19. }
  20. powermenu