From 0f9e6d3324378a002ce624485755a9ccaa5871fd Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Mon, 27 Nov 2023 17:30:35 -0800 Subject: [PATCH] Update swayidle-lock-screen --- swayidle-lock-screen | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/swayidle-lock-screen b/swayidle-lock-screen index 88daa63..23af118 100755 --- a/swayidle-lock-screen +++ b/swayidle-lock-screen @@ -9,7 +9,7 @@ function run { flock -n 4 || exit 0 dunstctl set-paused true 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="${!}" swaylock -e ${img_flags} kill "${swayidle_pid}" @@ -26,6 +26,8 @@ function fix_eww { } local background=false +local suspend_command='hyprctl dispatch dpms off' +local wake_command='hyprctl dispatch dpms on' local fix_eww=() while [[ "${1}" =~ '^-' ]]; do case "${1}" in @@ -40,6 +42,9 @@ while [[ "${1}" =~ '^-' ]]; do fix_eww+="${2}" shift ;; + -s) + local suspend_command='sudo /usr/lib/systemd/systemd-sleep suspend &' + ;; -*) printf "error: unknown flag '%s'\n" "${1}" >&2 ;;