Update swayidle-lock-screen

This commit is contained in:
Alexander Rosenberg 2023-11-27 17:30:35 -08:00
parent 1a7c989632
commit 0f9e6d3324
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -9,7 +9,7 @@ function run {
flock -n 4 || exit 0 flock -n 4 || exit 0
dunstctl set-paused true dunstctl set-paused true
swayidle -w -C /dev/null \ swayidle -w -C /dev/null \
timeout 15 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' & timeout 15 "${suspend_command}" resume "${wake_command}" &
local swayidle_pid="${!}" local swayidle_pid="${!}"
swaylock -e ${img_flags} swaylock -e ${img_flags}
kill "${swayidle_pid}" kill "${swayidle_pid}"
@ -26,6 +26,8 @@ function fix_eww {
} }
local background=false local background=false
local suspend_command='hyprctl dispatch dpms off'
local wake_command='hyprctl dispatch dpms on'
local fix_eww=() local fix_eww=()
while [[ "${1}" =~ '^-' ]]; do while [[ "${1}" =~ '^-' ]]; do
case "${1}" in case "${1}" in
@ -40,6 +42,9 @@ while [[ "${1}" =~ '^-' ]]; do
fix_eww+="${2}" fix_eww+="${2}"
shift shift
;; ;;
-s)
local suspend_command='sudo /usr/lib/systemd/systemd-sleep suspend &'
;;
-*) -*)
printf "error: unknown flag '%s'\n" "${1}" >&2 printf "error: unknown flag '%s'\n" "${1}" >&2
;; ;;