diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2024-11-01 11:26:27 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2024-11-01 11:26:27 +0300 |
commit | 8c33b8156f83e6a9e35f50ac130b53fc31b13964 (patch) | |
tree | 4a11919602734c5114c02c7386669c2766cbc95f /dotfiles/.local/bin | |
parent | e84f606efa9aba1e4b6c1425d229e6d89b33223a (diff) | |
download | swayrice-8c33b8156f83e6a9e35f50ac130b53fc31b13964.tar.gz swayrice-8c33b8156f83e6a9e35f50ac130b53fc31b13964.zip |
niri: turn off screen while idle in lock script
Diffstat (limited to 'dotfiles/.local/bin')
-rwxr-xr-x | dotfiles/.local/bin/lock-color | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/dotfiles/.local/bin/lock-color b/dotfiles/.local/bin/lock-color index 0611c29..fbf678f 100755 --- a/dotfiles/.local/bin/lock-color +++ b/dotfiles/.local/bin/lock-color @@ -1,10 +1,16 @@ #!/bin/sh -if [ -n "$SWAYSOCK"]; then +if [ -n "$SWAYSOCK" ]; then swaymsg input type:keyboard xkb_switch_layout 0 if [ "$1" != "screenon" ]; then - swayidle timeout 30 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' & + echo idling + swayidle timeout 30 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' & + fi +elif [ -n "$NIRI_SOCKET" ]; then + if [ "$1" != "screenon" ]; then + echo idling + swayidle timeout 3 'niri msg action power-off-monitors' resume 'niri msg action power-on-monitors' & fi fi |