config_sway/bin/start_swayidle.sh

21 lines
611 B
Bash
Raw Normal View History

2022-05-02 20:19:26 +02:00
#!/bin/bash
TERM_CMD="foot -T float"
LOCK_CMD="$HOME/.config/sway/bin/sway_lock"
SUS_CMD="$HOME/.config/sway/bin/sway_suspend"
### Idle configuration
# 10 min screen off
# 15 min lock
# 30 min suspend on battery
# 120 min suspend
pkill -x swayidle
swayidle -w \
2023-12-20 07:58:49 +01:00
timeout 1500 "$TERM_CMD bash -c 'dunstify -r 123 -u critical -t 300 display\ will\ turn\ off\ soon'" \
2022-05-02 20:19:26 +02:00
resume "$LOCK_CMD on" \
timeout 1800 "$LOCK_CMD off" \
timeout 2700 "$LOCK_CMD lockonly" \
timeout 3600 "$SUS_CMD suspend-battery" \
timeout 7200 "$SUS_CMD suspend" \
before-sleep "$LOCK_CMD lock"