Update system-sleep-menu.sh

This commit is contained in:
2026-08-10 13:55:25 -07:00
parent 26989b4c51
commit 195392ceaa
+4 -4
View File
@@ -32,17 +32,17 @@ function is_valid_sleep_time() {
if (( ${#running_locks} )); then if (( ${#running_locks} )); then
# We have existing locks # We have existing locks
local prompt plural_s local message plural_s
if (( ${#running_locks} > 2 )); then if (( ${#running_locks} > 2 )); then
let count_locks=$(( int(${#running_locks} / 2) )) let count_locks=$(( int(${#running_locks} / 2) ))
prompt="Locked by ${count_locks} locks until ${running_locks[2]}> " message="Locked by ${count_locks} locks until ${running_locks[2]}"
plural_s='s' plural_s='s'
else else
prompt="Locked until ${running_locks[2]}> " message="Locked until ${running_locks[2]}"
fi fi
local choice local choice
choice="$(printf "Cancel lock${plural_s}\n" \ choice="$(printf "Cancel lock${plural_s}\n" \
| fuzzel --dmenu --only-match --index -p "${prompt}")" | fuzzel --dmenu --only-match --index --mesg "${message}")"
if (( ${?} == 0 )) && (( ${choice} == 0 )); then if (( ${?} == 0 )) && (( ${choice} == 0 )); then
systemctl --user stop 'manual-inhibit-sleep@*.service' systemctl --user stop 'manual-inhibit-sleep@*.service'
fi fi