summaryrefslogtreecommitdiffstats
path: root/.local
diff options
context:
space:
mode:
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/sysact8
1 files 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