sisyphus/scripts/idle.sh
2022-04-28 11:27:39 +02:00

19 lines
597 B
Bash
Executable file

#!/usr/bin/env bash
# Configuration of swayidle
# Just run the script
# Kill previous instances to avoid clashing
pkill swayidle
swayidle -w \
timeout 300 \
'brightnessctl -s -set 15%' \
resume 'brightnessctl -r' \
timeout 600 \
'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
timeout 1200 \
'systemctl suspend' \
before-sleep 'swaylock -f --screenshots --clock --indicator --effect-blur 5x5; swaymsg "output * dpms on"'
# Screen needs to be turned back on or you will get a black screen after waking up again.