openrc fixes

This commit is contained in:
Luke Smith 2020-05-06 14:34:33 -04:00
parent 87dda7cdc3
commit f08f4b0b7f
No known key found for this signature in database
GPG key ID: 4C50B54A911F6252

View file

@ -2,8 +2,10 @@
# A dmenu wrapper script for system functions. # A dmenu wrapper script for system functions.
# For non-systemd init systems.
case "$(readlink -f /sbin/init)" in case "$(readlink -f /sbin/init)" in
*runit-init) hib="sudo -A zzz" ;; *runit*) hib="sudo -A zzz" ;;
*openrc*) reb="sudo -A openrc-shutdown -r"; shut="sudo -A openrc-shutdown -p" ;;
esac esac
cmds="\ cmds="\
@ -11,8 +13,8 @@ cmds="\
🚪 leave dwm kill -TERM $(pidof -s dwm) 🚪 leave dwm kill -TERM $(pidof -s dwm)
♻ renew dwm kill -HUP $(pidof -s dwm) ♻ renew dwm kill -HUP $(pidof -s dwm)
🐻 hibernate ${hib:-sudo -A systemctl suspend-then-hibernate} 🐻 hibernate ${hib:-sudo -A systemctl suspend-then-hibernate}
🔃 reboot sudo -A reboot 🔃 reboot ${reb:-sudo -A reboot}
🖥 shutdown sudo -A shutdown -h now" 🖥 shutdown ${shut:-sudo -A shutdown -h now}"
choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1 choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1