blob: 2ba80e79406cd1ee574423a8df06e467fa084976 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
[Unit]
Description=Idle manager for Wayland (dim + lock + DPMS)
PartOf=graphical-session.target
After=graphical-session.target
ConditionEnvironment=WAYLAND_DISPLAY
[Service]
Type=simple
ExecStart=%h/.nix-profile/bin/swayidle -w \
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; 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
[Install]
WantedBy=sway-session.target
|