blob: 32fe1184b9d82d5a391289cfa4db883dfb5dc64f (
plain) (
tree)
|
|
#!/bin/sh
# A dmenu wrapper script for system functions.
case "$(readlink -f /sbin/init)" in
*systemd*) ctl='systemctl' ;;
*) ctl='loginctl' ;;
esac
case "$(printf " lock\n display off\n logout\n sleep\n reboot\n shutdown" | dmenu -i -p 'Action: ')" in
' lock') slock ;;
' display off') xset dpms force off ;;
' logout') kill -TERM "$(pgrep -u "$USER" "\bdwm$")" ;;
' sleep') slock $ctl suspend ;;
' reboot') $ctl reboot ;;
' shutdown') $ctl poweroff ;;
*) exit 1 ;;
esac
|