configurable notification timeout, default 3s
This commit is contained in:
parent
28fb0e4d00
commit
dea4541718
3 changed files with 11 additions and 3 deletions
|
|
@ -20,7 +20,8 @@ QtObject {
|
|||
enable: true
|
||||
})
|
||||
property var notifications: ({
|
||||
enable: true
|
||||
enable: true,
|
||||
timeout: 3000
|
||||
})
|
||||
property var mpris: ({
|
||||
enable: true
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import QtQuick
|
|||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Services.Notifications
|
||||
import "." as M
|
||||
|
||||
QtObject {
|
||||
id: root
|
||||
|
|
@ -84,7 +85,7 @@ QtObject {
|
|||
|
||||
// Auto-expire popup
|
||||
if (data.popup) {
|
||||
const timeout = notif.expireTimeout > 0 ? notif.expireTimeout : 5000;
|
||||
const timeout = notif.expireTimeout > 0 ? notif.expireTimeout : (M.Modules.notifications.timeout || 3000);
|
||||
Qt.callLater(() => {
|
||||
_expireTimer.createObject(root, {
|
||||
_notifId: data.id,
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@ in
|
|||
"tray"
|
||||
"windowTitle"
|
||||
"clock"
|
||||
"notifications"
|
||||
"mpris"
|
||||
"volume"
|
||||
"idleInhibitor"
|
||||
|
|
@ -91,6 +90,13 @@ in
|
|||
in
|
||||
simpleModules
|
||||
// {
|
||||
notifications = moduleOpt "notifications" {
|
||||
timeout = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 3000;
|
||||
description = "Notification popup timeout in milliseconds.";
|
||||
};
|
||||
};
|
||||
bluetooth = moduleOpt "bluetooth" (intervalOpt 5000);
|
||||
network = moduleOpt "network" (intervalOpt 5000);
|
||||
powerProfile = moduleOpt "powerProfile" (intervalOpt 5000);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue