Fix notification expire timeout being treated as seconds instead of milliseconds

This commit is contained in:
David Heinemeier Hansson
2026-06-29 13:24:04 -05:00
parent 1220a031b3
commit fed2fd8e3d
2 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -125,7 +125,7 @@ case "$PROCESSING" in
wl-copy --type image/png <"$FILEPATH" wl-copy --type image/png <"$FILEPATH"
( (
if [[ -n $(omarchy-notification-send "Screenshot saved to clipboard and file" "Edit with Super + Alt + , (or click this)" -t 10000 --image "$FILEPATH" -a) ]]; then if [[ -n $(omarchy-notification-send "Screenshot saved to clipboard and file" "Edit with Super + Alt + , (or click this)" --image "$FILEPATH" -a) ]]; then
open_editor "$FILEPATH" open_editor "$FILEPATH"
fi fi
) >/dev/null 2>&1 & ) >/dev/null 2>&1 &
+5 -3
View File
@@ -109,9 +109,11 @@ Item {
} }
function requestedDuration(expireTimeout) { function requestedDuration(expireTimeout) {
var seconds = Number(expireTimeout || 0) // FreeDesktop notification spec (and Quickshell) report expireTimeout in
if (!isFinite(seconds) || seconds <= 0) return 0 // milliseconds, so pass it through directly.
return Math.round(seconds * 1000) var ms = Number(expireTimeout || 0)
if (!isFinite(ms) || ms <= 0) return 0
return Math.round(ms)
} }
// DND bypass: only let through notifications we trust to be intentional // DND bypass: only let through notifications we trust to be intentional