2023-05-03 10:19:35 -04:00
|
|
|
#!/bin/zsh
|
2024-01-31 07:06:43 -05:00
|
|
|
if [[ -z "$1" ]] && [[ "$WINDOW_MANAGER" == "river" ]] ; then
|
2023-05-03 10:19:35 -04:00
|
|
|
swayidle -w \
|
|
|
|
timeout 310 'swaylock' \
|
2024-01-31 07:06:43 -05:00
|
|
|
timeout 300 'wlopm --off "*"' resume 'wlopm --on "*"' \
|
|
|
|
before-sleep "swaylock"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -z "$1" ]] && [[ "$WINDOW_MANAGER" == "sway" ]] ; then
|
|
|
|
swayidle -w \
|
|
|
|
timeout 310 'swaylock' \
|
|
|
|
timeout 300 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
|
2024-01-27 03:42:16 -05:00
|
|
|
before-sleep "swaylock"
|
2023-05-03 10:19:35 -04:00
|
|
|
fi
|
2024-01-27 03:42:16 -05:00
|
|
|
|
|
|
|
#timeout 300 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
|
|
|
|
|
2023-05-03 10:19:35 -04:00
|
|
|
if [[ $1 == "-k" ]]; then
|
|
|
|
killall swayidle
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
if [[ $1 != "-k" ]]; then
|
|
|
|
echo 'wrong syntax, do idle or idle -k'
|
|
|
|
fi
|