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

: ${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