random-scripts/swayidle-lock-screen

17 lines
305 B
Plaintext
Raw Normal View History

2023-09-10 03:11:44 -07:00
#!/usr/bin/env zsh
2023-09-10 03:26:19 -07:00
function run {
swayidle -w -C /dev/null \
timeout 15 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' &
local swayidle_pid="$!"
swaylock
kill "${swayidle_pid}"
hyprctl dispatch dpms on
}
if [[ "${1}" == '-f' ]]; then
run &
else
run
fi