voidrice/.local/bin/sysact

15 lines
331 B
Text
Raw Normal View History

2020-04-15 02:10:38 +00:00
#!/bin/sh
# A dmenu wrapper script for system functions.
cmds="\
lock screen slock
leave dwm kill -TERM $(pidof -s dwm)
refresh dwm kill -HUP $(pidof -s dwm)
reboot sudo -A reboot
shutdown sudo -A shutdown -h now"
2020-04-15 02:10:38 +00:00
choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1
2020-04-15 02:10:38 +00:00
`echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-`