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:
1 parent
065b728af6
commit
8d9903b65e
1 file changed
+3
-2
@@ -85,11 +85,12 @@ Singleton {
|
|||||||
function critical(n) {
|
function critical(n) {
|
||||||
return !!n && n.urgency === NotificationUrgency.Critical;
|
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) {
|
function timeoutFor(n) {
|
||||||
if (critical(n))
|
if (critical(n))
|
||||||
return 0;
|
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) {
|
function since(n) {
|
||||||
const at = n ? times[n.id] : undefined;
|
const at = n ? times[n.id] : undefined;
|
||||||
|
|||||||
Reference in new issue
Block a user