2020-04-15 02:10:38 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# A dmenu wrapper script for system functions.
|
|
|
|
|
2020-05-06 13:50:00 +00:00
|
|
|
case "$(readlink -f /sbin/init)" in
|
|
|
|
*runit-init) hib="sudo -A zzz" ;;
|
|
|
|
esac
|
|
|
|
|
2020-04-15 02:10:38 +00:00
|
|
|
cmds="\
|
2020-05-04 14:30:11 +00:00
|
|
|
🔒 lock slock
|
|
|
|
🚪 leave dwm kill -TERM $(pidof -s dwm)
|
|
|
|
♻ renew dwm kill -HUP $(pidof -s dwm)
|
2020-05-06 13:50:00 +00:00
|
|
|
🐻 hibernate ${hib:-sudo -A systemctl suspend-then-hibernate}
|
2020-05-04 14:30:11 +00:00
|
|
|
🔃 reboot sudo -A reboot
|
|
|
|
🖥 shutdown sudo -A shutdown -h now"
|
2020-04-15 02:10:38 +00:00
|
|
|
|
2020-04-28 12:50:57 +00:00
|
|
|
choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1
|
2020-04-15 02:10:38 +00:00
|
|
|
|
2020-04-28 12:50:57 +00:00
|
|
|
`echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-`
|