Read notification expire timeouts as milliseconds

Quickshell hands expireTimeout through in ms, so multiplying by 1000 kept
a notify-send -t 3000 popup up for about 50 minutes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-11-14 17:17:04 +01:00
1 parent 065b728af6
commit 8d9903b65e
1 file changed
+3 -2
+3 -2
View File
@@ -85,11 +85,12 @@ Singleton {
function critical(n) {
return !!n && n.urgency === NotificationUrgency.Critical;
}
// Popup lifetime in ms; 0 keeps it until dismissed.
// Popup lifetime in ms; 0 keeps it until dismissed. Quickshell passes the
// sender's expire_timeout through in milliseconds (notify-send -t 3000 is 3000).
function timeoutFor(n) {
if (critical(n))
return 0;
return n.expireTimeout > 0 ? Math.round(Math.max(1, n.expireTimeout) * 1000) : options.timeout;
return n.expireTimeout > 0 ? Math.round(Math.max(1000, n.expireTimeout)) : options.timeout;
}
function since(n) {
const at = n ? times[n.id] : undefined;