Notifications expire after 30 s, never critical
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
8832e29552
commit
9a3dd06fb5
2 files changed
+14
-3
No files matched your search
+5
-3
@@ -191,14 +191,16 @@ async function sendNative(ctx: Ctx, wants: { readonly desktop: boolean; readonly
|
|||||||
ctx.logger.debug('The bridge has no target for the enabled channels.');
|
ctx.logger.debug('The bridge has no target for the enabled channels.');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const lines = reportLines(report, ctx.settings.values.template, (e) => { warnTemplate(ctx, e); });
|
const values = ctx.settings.values;
|
||||||
|
const lines = reportLines(report, values.template, (e) => { warnTemplate(ctx, e); });
|
||||||
const result = await ctx.native.notify({
|
const result = await ctx.native.notify({
|
||||||
title: lines[0] ?? `${report.joiner.name} joined`,
|
title: lines[0] ?? `${report.joiner.name} joined`,
|
||||||
content: lines.slice(1).join('\n'),
|
content: lines.slice(1).join('\n'),
|
||||||
timeoutSecs: 8,
|
timeoutSecs: values.notifyTimeoutSecs,
|
||||||
icon: 'security-high',
|
icon: 'security-high',
|
||||||
sinks,
|
sinks,
|
||||||
urgency: accentFor(report) === 'warn' ? 'critical' : 'normal',
|
// Never critical: KDE ignores the expiry for critical notifications and keeps them on screen.
|
||||||
|
urgency: 'normal',
|
||||||
});
|
});
|
||||||
for (const failure of result.failed) {
|
for (const failure of result.failed) {
|
||||||
if (failure.sink !== 'bridge') ctx.logger.warn(`Bridge target ${failure.sink} failed: ${failure.error}`);
|
if (failure.sink !== 'bridge') ctx.logger.warn(`Bridge target ${failure.sink} failed: ${failure.error}`);
|
||||||
|
|||||||
@@ -110,6 +110,15 @@ export const settings = {
|
|||||||
description: 'Through the VRCNext Bridge on any platform, or VRCNext’s tray toast on Windows.',
|
description: 'Through the VRCNext Bridge on any platform, or VRCNext’s tray toast on Windows.',
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
notifyTimeoutSecs: {
|
||||||
|
kind: 'number',
|
||||||
|
label: 'Seconds a desktop or VR notification stays',
|
||||||
|
description: 'Sent as the notification’s expiry. KDE keeps "critical" notifications until dismissed, so reports are never sent as critical.',
|
||||||
|
default: 30,
|
||||||
|
min: 1,
|
||||||
|
max: 60,
|
||||||
|
step: 1,
|
||||||
|
},
|
||||||
notifyVr: {
|
notifyVr: {
|
||||||
kind: 'boolean',
|
kind: 'boolean',
|
||||||
label: 'VR overlay notification',
|
label: 'VR overlay notification',
|
||||||
|
|||||||
Reference in new issue
Block a user