From 5f4037b5ef6c7e9913c35a59ed149b2f7e92ce61 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 11 Feb 2023 14:39:29 +0100 Subject: [PATCH] river: Fix idle management Another go at improving the screen dimming and suspending setup: Lockscreen invocation after 5 minutes, dimming at 10, sleep after 15 - but only when not on AC. It tries to also fix the screen being stuck off by reordering the timeout and resume options of swayidle. --- desktop/.config/river/init | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/desktop/.config/river/init b/desktop/.config/river/init index 151c69d..7a95637 100755 --- a/desktop/.config/river/init +++ b/desktop/.config/river/init @@ -5,7 +5,7 @@ modemod="Mod1" term=${TERMINAL:-foot} time_to_lockscreen=300 time_to_screendim=600 -time_to_suspend=1200 +time_to_suspend=900 ## OPTIONS riverctl spawn "dbus-update-activation-environment SEATD_SOCK DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river" @@ -268,13 +268,13 @@ unset loc # start screen idle locking/dimming/sleep tool killall swayidle riverctl spawn "swayidle \ - timeout ${time_to_lockscreen} 'pidof waylock || lockscreen' \ - timeout ${time_to_screendim} 'wlopm --off \"*\"' \ - timeout ${time_to_suspend} 'systemctl suspend-then-hibernate' \ - resume 'wlopm --on \"*\"' \ - after-resume 'wlopm --on \"*\"' \ - before-sleep 'pidof waylock || lockscreen' &" - + timeout ${time_to_suspend} \"systemctl suspend-then-hibernate\" \ + timeout ${time_to_suspend} \"[ $(cat /sys/class/power_supply/AC/online) -eq 0 ] && systemctl suspend-then-hibernate\" + timeout ${time_to_screendim} \"wlopm --off '*'\" \ + resume \"wlopm --on '*'\" \ + timeout ${time_to_lockscreen} \"pidof waylock || lockscreen\" \ + after-resume \"wlopm --on '*'\" \ + before-sleep \"pidof waylock || lockscreen\" &" killall clipman riverctl spawn "wl-paste -t text --watch clipman store" # bash ~/.config/bin/gtktheme # setting our gtk variables