From 3a01dad945c749257fb0fa05066f3fd20b09bed9 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 20 Sep 2025 10:47:09 +0200 Subject: [PATCH] aloow configuration of notif timeout duration --- .config/quickshell/ii/modules/common/Config.qml | 4 ++++ .../ii/modules/settings/InterfaceConfig.qml | 16 ++++++++++++++++ .config/quickshell/ii/services/Notifications.qml | 4 ++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.config/quickshell/ii/modules/common/Config.qml b/.config/quickshell/ii/modules/common/Config.qml index d80b2b89f..d5e0a440a 100644 --- a/.config/quickshell/ii/modules/common/Config.qml +++ b/.config/quickshell/ii/modules/common/Config.qml @@ -266,6 +266,10 @@ Singleton { property string userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" } + property JsonObject notifications: JsonObject { + property int timeout: 7000 + } + property JsonObject osd: JsonObject { property int timeout: 1000 } diff --git a/.config/quickshell/ii/modules/settings/InterfaceConfig.qml b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml index bbb6a5604..7df973622 100644 --- a/.config/quickshell/ii/modules/settings/InterfaceConfig.qml +++ b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml @@ -141,6 +141,22 @@ ContentPage { } } + ContentSection { + icon: "notifications" + title: Translation.tr("Notifications") + + ConfigSpinBox { + text: Translation.tr("Timeout duration (if not defined by notification) (ms)") + value: Config.options.notifications.timeout + from: 1000 + to: 60000 + stepSize: 1000 + onValueChanged: { + Config.options.notifications.timeout = value; + } + } + } + ContentSection { icon: "side_navigation" title: Translation.tr("Sidebars") diff --git a/.config/quickshell/ii/services/Notifications.qml b/.config/quickshell/ii/services/Notifications.qml index f1f279672..00a87c3a7 100644 --- a/.config/quickshell/ii/services/Notifications.qml +++ b/.config/quickshell/ii/services/Notifications.qml @@ -60,7 +60,7 @@ Singleton { component NotifTimer: Timer { required property int notificationId - interval: 5000 + interval: 7000 running: true onTriggered: () => { root.timeoutNotification(notificationId); @@ -168,7 +168,7 @@ Singleton { if (notification.expireTimeout != 0) { newNotifObject.timer = notifTimerComponent.createObject(root, { "notificationId": newNotifObject.notificationId, - "interval": notification.expireTimeout < 0 ? 5000 : notification.expireTimeout, + "interval": notification.expireTimeout < 0 ? (Config?.options.notifications.timeout ?? 7000) : notification.expireTimeout, }); } }