Dim screen on inactivity, then lock it

This commit is contained in:
2023-12-27 22:20:05 +03:00
parent 6ed1448668
commit 582418bbee
4 changed files with 54 additions and 2 deletions

View File

@ -32,6 +32,15 @@ monitor=HDMI-A-1,preferred,0x0,1.3
exec-once = dunst
exec-once = /usr/libexec/kf5/polkit-kde-authentication-agent-1
# Dim screen after 60 seconds of inactivity
exec-once = swayidle -w timeout 60 'dim-screen &' resume 'undim-screen'
# Lock screen after idle for 300s
exec-once = swayidle -w timeout 300 'lock-screen'
# Dim screen 5 seconds after screen is locked. no -w option here.
exec-once = swayidle timeout 5 'if pgrep -x swaylock; then dim-screen; fi' resume 'undim-screen'
# Turn monitors off 20 seconds after screen is locked
exec-once = swayidle -w timeout 20 'if pgrep -x swaylock; then hyprctl dispatch dpms off; fi' resume 'hyprctl dispatch dpms on'
# exec-once = /usr/libexec/polkit-gnome-authentication-agent-1
# Source a file (multi-file configs)
@ -219,14 +228,17 @@ bindm = $mainMod, mouse:273, resizewindow
# screen
bindle=,XF86MonBrightnessUp, exec, light -A 5
bindle=,XF86MonBrightnessDown, exec, light -U 5
bindle=,XF86MonBrightnessUp, exec, light -A 3; light -O
bindle=,XF86MonBrightnessDown, exec, light -U 3; light -O
# bindle=,XF86KbdBrightnessUp, exec, ags -r 'brightness.kbd++; indicator.kbd()'
# bindle=,XF86KbdBrightnessDown, exec, ags -r 'brightness.kbd--; indicator.kbd()'
#
#
bindle=,XF86AudioRaiseVolume, exec, volume up
bindle=,XF86AudioLowerVolume, exec, volume down
bindle=,XF86AudioMute, exec, volume toggle-mute
bind = $mainMod SHIFT, q, exec, lock-screen
# bindl = $mainMod SHIFT, L, exec, sleep 1 && hyprctl dispatch dpms off
windowrulev2 = stayfocused,class:(wofi)