From f08f4b0b7f8bf4c569f679f301313d563406b851 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 6 May 2020 14:34:33 -0400 Subject: [PATCH] openrc fixes --- .local/bin/sysact | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.local/bin/sysact b/.local/bin/sysact index a404257..0a7cdd0 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -2,8 +2,10 @@ # A dmenu wrapper script for system functions. +# For non-systemd init systems. 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 cmds="\ @@ -11,8 +13,8 @@ cmds="\ 🚪 leave dwm kill -TERM $(pidof -s dwm) ♻ renew dwm kill -HUP $(pidof -s dwm) 🐻 hibernate ${hib:-sudo -A systemctl suspend-then-hibernate} -🔃 reboot sudo -A reboot -🖥 shutdown sudo -A shutdown -h now" +🔃 reboot ${reb:-sudo -A reboot} +🖥 shutdown ${shut:-sudo -A shutdown -h now}" choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1