forked from Shinonome/dots-hyprland
reduce persistent low battery warnings
This commit is contained in:
@@ -38,7 +38,8 @@ Singleton {
|
|||||||
Translation.tr("Low battery"),
|
Translation.tr("Low battery"),
|
||||||
Translation.tr("Consider plugging in your device"),
|
Translation.tr("Consider plugging in your device"),
|
||||||
"-u", "critical",
|
"-u", "critical",
|
||||||
"-a", "Shell"
|
"-a", "Shell",
|
||||||
|
"--hint=int:transient:1",
|
||||||
])
|
])
|
||||||
|
|
||||||
if (root.soundEnabled) Audio.playSystemSound("dialog-warning");
|
if (root.soundEnabled) Audio.playSystemSound("dialog-warning");
|
||||||
@@ -51,7 +52,8 @@ Singleton {
|
|||||||
Translation.tr("Critically low battery"),
|
Translation.tr("Critically low battery"),
|
||||||
Translation.tr("Please charge!\nAutomatic suspend triggers at %1%").arg(Config.options.battery.suspend),
|
Translation.tr("Please charge!\nAutomatic suspend triggers at %1%").arg(Config.options.battery.suspend),
|
||||||
"-u", "critical",
|
"-u", "critical",
|
||||||
"-a", "Shell"
|
"-a", "Shell",
|
||||||
|
"--hint=int:transient:1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (root.soundEnabled) Audio.playSystemSound("suspend-error");
|
if (root.soundEnabled) Audio.playSystemSound("suspend-error");
|
||||||
@@ -69,7 +71,8 @@ Singleton {
|
|||||||
"notify-send",
|
"notify-send",
|
||||||
Translation.tr("Battery full"),
|
Translation.tr("Battery full"),
|
||||||
Translation.tr("Please unplug the charger"),
|
Translation.tr("Please unplug the charger"),
|
||||||
"-a", "Shell"
|
"-a", "Shell",
|
||||||
|
"--hint=int:transient:1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (root.soundEnabled) Audio.playSystemSound("complete");
|
if (root.soundEnabled) Audio.playSystemSound("complete");
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ Singleton {
|
|||||||
"text": action.text,
|
"text": action.text,
|
||||||
})) ?? []
|
})) ?? []
|
||||||
property bool popup: false
|
property bool popup: false
|
||||||
|
property bool isTransient: notification?.hints.transient ?? false
|
||||||
property string appIcon: notification?.appIcon ?? ""
|
property string appIcon: notification?.appIcon ?? ""
|
||||||
property string appName: notification?.appName ?? ""
|
property string appName: notification?.appName ?? ""
|
||||||
property string body: notification?.body ?? ""
|
property string body: notification?.body ?? ""
|
||||||
@@ -63,7 +64,11 @@ Singleton {
|
|||||||
interval: 7000
|
interval: 7000
|
||||||
running: true
|
running: true
|
||||||
onTriggered: () => {
|
onTriggered: () => {
|
||||||
root.timeoutNotification(notificationId);
|
const index = root.list.findIndex((notif) => notif.notificationId === notificationId);
|
||||||
|
const notifObject = root.list[index];
|
||||||
|
print("[Notifications] Notification timer triggered for ID: " + notificationId + ", transient: " + notifObject?.isTransient);
|
||||||
|
if (notifObject.isTransient) root.discardNotification(notificationId);
|
||||||
|
else root.timeoutNotification(notificationId);
|
||||||
destroy()
|
destroy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user