powermenu 211 B

12345678910111213141516
  1. #!/bin/sh
  2. # switch power state using dmenu
  3. sel=$(printf 'poweroff\nreboot\nsuspend\nlock' \
  4. | dmenu -f -i -l 4 \
  5. )
  6. case "${sel}" in
  7. poweroff|reboot|suspend)
  8. systemctl "${sel}"
  9. ;;
  10. lock)
  11. lock
  12. ;;
  13. esac