[s6] swayidle: use env vars to set timeouts

This commit is contained in:
odrling 2023-10-31 04:36:54 +01:00
parent 06bd09c469
commit abe6ca39ee
No known key found for this signature in database
GPG key ID: A0145F975F9F8B75
2 changed files with 7 additions and 2 deletions

View file

@ -7,6 +7,9 @@ export XDG_CONFIG_HOME="$HOME/.config"
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
export S6_SCANDIR="$HOME/.s6/scandir"
export SWAYIDLE_LOCK=300
export SWAYIDLE_TURN_OFF=600
export GTK_THEME=Arc
export LESS="-R -z-2 -j4"

View file

@ -1,7 +1,9 @@
#!/bin/execlineb -P
importas SWAYIDLE_LOCK SWAYIDLE_LOCK
importas SWAYIDLE_TURN_OFF SWAYIDLE_TURN_OFF
swayidle -w
timeout 300 "swaylock -f"
timeout 600 "toggle_monitors off"
timeout ${SWAYIDLE_LOCK} "swaylock -f"
timeout ${SWAYIDLE_TURN_OFF} "toggle_monitors off"
resume "toggle_monitors on"
after-resume "toggle_monitors on"
before-sleep "swaylock -f"