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.
This commit is contained in:
Marty Oehme 2023-02-11 14:39:29 +01:00
parent beb2c7531a
commit 5f4037b5ef
Signed by: Marty
GPG Key ID: EDBF2ED917B2EF6A
1 changed files with 8 additions and 8 deletions

View File

@ -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