#!/bin/sh time_to_lockscreen="${time_to_lockscreen:-300}" time_to_screendim="${time_to_screendim:-600}" time_to_suspend="${time_to_suspend:-900}" [ -r ./conf ] && . ./conf exec 2>&1 # usual setup: # waylock -init-color 0x223344 -input-color 0x224444 -fail-color 0x554444 -fork-on-lock exec chpst -e "$TURNSTILE_ENV_DIR" swayidle \ timeout "${time_to_suspend}" "[ $(cat /sys/class/power_supply/AC/online) -eq 0 ] && sudo zzz" \ timeout "${time_to_screendim}" "wlopm --off '*'" \ resume "wlopm --on '*'" \ timeout "${time_to_lockscreen}" "pidof waylock || lockscreen" \ after-resume "wlopm --on '*'" \ before-sleep "pidof waylock || lockscreen"