2020-06-11 23:04:14 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-02-27 20:26:56 +01:00
|
|
|
lock="swaylock"
|
2020-06-11 23:04:14 +02:00
|
|
|
lockt="exec ~/utils/bin/sway-locker -t"
|
|
|
|
|
|
|
|
revert() {
|
|
|
|
killall swayidle
|
|
|
|
swayidle -w timeout 3600 "$lock" \
|
2023-07-10 04:18:04 +02:00
|
|
|
timeout 3610 'swaymsg "output * power off"' \
|
|
|
|
resume 'swaymsg "output * power on"' \
|
2020-06-11 23:04:14 +02:00
|
|
|
before-sleep "$lockt"
|
|
|
|
}
|
|
|
|
trap revert HUP INT TERM
|
2023-07-10 04:18:04 +02:00
|
|
|
swayidle -w timeout 5 'swaymsg "output * power off"' \
|
|
|
|
resume 'swaymsg "output * power on"' &
|
2021-03-15 15:12:32 +01:00
|
|
|
swaylock -C ~/.config/swaylock/config
|
2020-06-11 23:04:14 +02:00
|
|
|
revert
|