dotfiles/dot_local/bin/executable_swayidle-laptop

18 lines
586 B
Text
Raw Normal View History

2023-06-16 00:44:03 -04:00
#!/bin/bash
# dim screen after 2 minutes, turn screen off after 10, suspend after an hour
echo "---" | tee -a /tmp/swayidle-dim.log
swayidle -w \
timeout 120 "light -O && light -S .1" \
resume "light -I" \
2>&1 | tee -a /tmp/swayidle-dim.log & disown
echo "---" | tee -a /tmp/swayidle.log
swayidle -w \
timeout 600 "wlr-randr --output eDP-1 --off" \
timeout 3600 "loginctl suspend" \
resume "wlr-randr --output eDP-1 --on" \
before-sleep "if ![[ pgrep -x waylock ]]; then waylock -fork-on-lock -init-color 0x000000; fi" \
2>&1 | tee -a /tmp/swayidle.log & disown