diff options
Diffstat (limited to 'dot_config/systemd')
| -rw-r--r-- | dot_config/systemd/user/swayidle.service | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/dot_config/systemd/user/swayidle.service b/dot_config/systemd/user/swayidle.service index bd0dca5..2ba80e7 100644 --- a/dot_config/systemd/user/swayidle.service +++ b/dot_config/systemd/user/swayidle.service @@ -1,5 +1,5 @@ [Unit] -Description=Idle manager for Wayland (lock + DPMS) +Description=Idle manager for Wayland (dim + lock + DPMS) PartOf=graphical-session.target After=graphical-session.target ConditionEnvironment=WAYLAND_DISPLAY @@ -7,12 +7,14 @@ ConditionEnvironment=WAYLAND_DISPLAY [Service] Type=simple ExecStart=%h/.nix-profile/bin/swayidle -w \ - timeout 300 'swaymsg "output * power off"' \ - resume 'swaymsg "output * power on"' \ - timeout 330 'swaylock -f -e -c 000000' \ + timeout 300 'brightnessctl -s set 10% || true' \ + resume 'brightnessctl -r || true' \ + timeout 330 'pgrep -x swaylock >/dev/null || swaylock -f -e -c 000000' \ + timeout 360 'swaymsg "output * power off"' \ + resume '%h/.config/sway/display-wake.sh' \ timeout 1800 '%h/.local/bin/on-battery-suspend' \ - before-sleep 'playerctl -a pause; swaylock -f -e -c 000000' \ - lock 'swaylock -f -e -c 000000' + before-sleep 'playerctl -a pause; pgrep -x swaylock >/dev/null || swaylock -f -e -c 000000' \ + lock 'pgrep -x swaylock >/dev/null || swaylock -f -e -c 000000' Restart=on-failure RestartSec=2s |
