2023-06-16 00:44:03 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-06-17 00:03:57 -04:00
|
|
|
START_TIME=`date +"%b %d, %Y %T"`
|
|
|
|
#LOG_FILE_DIM="${XDG_STATE_HOME}"/swayidle-dim.log
|
|
|
|
LOG_FILE_LOCK="${XDG_STATE_HOME}"/swayidle.log
|
|
|
|
|
|
|
|
#echo "--- ${START_TIME} ---" > "$LOG_FILE_DIM"
|
|
|
|
echo "--- ${START_TIME} ---" > "$LOG_FILE_LOCK"
|
|
|
|
|
|
|
|
# kill running processes
|
|
|
|
killall -q swayidle
|
|
|
|
|
|
|
|
# dim screen after 2 minutes, lock after 5, turn off after 15, suspend after 60
|
|
|
|
#swayidle -w \
|
|
|
|
# timeout 120 'light -O && light -S .1' \
|
|
|
|
# resume 'light -I' \
|
|
|
|
# 2>&1 | tee -a "$LOG_FILE_DIM" & disown
|
2023-06-16 00:44:03 -04:00
|
|
|
|
|
|
|
swayidle -w \
|
2023-06-17 00:03:57 -04:00
|
|
|
timeout 120 'light -O && light -S .1' \
|
|
|
|
resume 'light -I' \
|
|
|
|
timeout 300 'waylock-launcher' \
|
|
|
|
resume 'light -I' \
|
|
|
|
timeout 900 'light -I && wlr-randr --output eDP-1 --off' \
|
|
|
|
resume 'wlr-randr --output eDP-1 --on && kanshictl reload' \
|
2023-06-17 01:34:05 -04:00
|
|
|
timeout 3600 'loginctl suspend-then-hibernate' \
|
2023-06-17 00:03:57 -04:00
|
|
|
resume 'wlr-randr --output eDP-1 --on && kanshictl reload' \
|
|
|
|
2>&1 | "$LOG_FILE_LOCK" & disown
|
2023-06-16 00:44:03 -04:00
|
|
|
|