From 261935c27a5591115e92b75eebb800980d6ee3eb Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 19 Dec 2022 17:04:44 +0100 Subject: [PATCH] wayland: Add automatic dimming and suspend Added automatic: a) screen locking after 5 minutes b) screen dimming after 10 minutes c) suspending after 20 minutes to riverwm. Makes use of swayidle to detect idle times and wlopm to detect and toggle displays. --- wayland/.config/river/init | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/wayland/.config/river/init b/wayland/.config/river/init index cdb08bb..597058c 100755 --- a/wayland/.config/river/init +++ b/wayland/.config/river/init @@ -3,6 +3,9 @@ mod="Mod4" modemod="Mod1" term=${TERMINAL:-foot} +time_to_lockscreen=300 +time_to_screendim=600 +time_to_suspend=1200 ## OPTIONS riverctl spawn "dbus-update-activation-environment SEATD_SOCK DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river" @@ -241,8 +244,19 @@ killall waybar exec waybar & # start dynamic display configuration +killall kanshi exec kanshi & +# start screen idle locking/dimming/sleep tool +killall swayidle +exec swayidle -w \ + timeout "${time_to_lockscreen}" 'lockscreen' \ + timeout "${time_to_screendim}" 'wlopm --off "*"' \ + timeout "${time_to_suspend}" 'systemctl suspend-then-hibernate' \ + resume 'wlopm --on "*"' \ + after-resume 'wlopm --on "*"' \ + before-sleep 'lockscreen' & + killall clipman exec wl-paste -t text --watch clipman store & # bash ~/.config/bin/gtktheme # setting our gtk variables