From 5b364aec48d428b862540833730955f0b9fc621d Mon Sep 17 00:00:00 2001 From: Ethan Marshall Date: Mon, 5 Apr 2021 19:54:04 +0100 Subject: [PATCH] Add option to sleep, not hibernate Add the option for some users (like me) who either don't use swap or don't have much of it, and so aren't allowed to hibernate by the kernel. Instead of telling the kernel to suspend then hibernate, just suspend. --- .local/bin/sysact | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.local/bin/sysact b/.local/bin/sysact index b64b5e38..91df9ff6 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -5,6 +5,7 @@ # For systemd-based systems. case "$(readlink -f /sbin/init)" in *systemd*) + slp="systemctl suspend -i" hib="systemctl suspend-then-hibernate -i" shut="systemctl poweroff -i" reb="systemctl reboot -i";; @@ -14,6 +15,7 @@ cmds="\ 🔒 lock slock 🚪 leave dwm kill -TERM $(pgrep -u $USER "\bdwm$") ♻ renew dwm kill -HUP $(pgrep -u $USER "\bdwm$") +💤 sleep slock ${slp:-loginctl suspend -i} 🐻 hibernate slock ${hib:-loginctl suspend-then-hibernate -i} 🔃 reboot ${reb:-loginctl reboot -i} 🖥 shutdow ${shut:-systemctl poweroff -i}