aboutsummaryrefslogtreecommitdiff
path: root/bin/dmenu_power
blob: 7bacda88779152edf3c147651e1cc3ce5fdd8c46 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

: ${DMENU:=dmenu}
ret=$(echo "Suspend\nLock\nHibernate\nReboot\nShutdown" | ${DMENU} -p "Power:" -i | tr '[A-Z]' '[a-z]')
case "$ret" in
  suspend)   sudo zzz    ;;
  lock)      slock       ;;
  hibernate) sudo ZZZ    ;;
  reboot)    sudo reboot ;;
  shutdown)  sudo halt   ;;
esac