.dotfiles/.config/sway/idle.fish

17 lines
521 B
Fish
Raw Normal View History

2024-10-21 21:34:03 +03:00
#!/bin/env fish
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.
set lock 'swaylock -f -c 000000'
set off 'swaymsg "output * power off"'
set resume 'swaymsg "output * power on"'
set before_sleep 'swaylock -f -c 000000'
exec swayidle -w \
timeout 300 $lock \
2024-10-22 11:22:29 +03:00
timeout 900 $off \
2024-10-21 21:34:03 +03:00
resume $resume \
before-sleep $before_sleep