From 7ab784e101b69f35f65e300d5779888624f7a7a5 Mon Sep 17 00:00:00 2001 From: Damocles Date: Wed, 29 Apr 2026 18:22:35 +0200 Subject: [PATCH] battery: remove dead notification code, poweralertd handles this via hm-module --- shell/services/BatteryService.qml | 42 ------------------------------- test/qmllint-baseline.txt | 1 - 2 files changed, 43 deletions(-) diff --git a/shell/services/BatteryService.qml b/shell/services/BatteryService.qml index 2031c3e..e8e115f 100644 --- a/shell/services/BatteryService.qml +++ b/shell/services/BatteryService.qml @@ -1,7 +1,6 @@ pragma Singleton import QtQuick -import Quickshell.Io import Quickshell.Services.UPower import "." as S @@ -46,47 +45,6 @@ QtObject { } } - // Low battery notifications - property bool _warnSent: false - property bool _critSent: false - - property var _chargingWatcher: Connections { - target: root - function onChargingChanged() { - root._warnSent = false; - root._critSent = false; - } - function onPercentChanged() { - if (root.charging) - return; - if (root.percent < root.critThresh && !root._critSent) { - root._critSent = true; - root._warnSent = true; - root._sendNotif(2, "battery-low", "Very Low Battery", "Connect to power now!"); - } else if (root.percent < root.warnThresh && !root._warnSent) { - root._warnSent = true; - root._sendNotif(1, "battery-caution", "Low Battery", ""); - } - } - } - - // Send notification via D-Bus so any active daemon receives it - function _sendNotif(urgency, icon, summary, body) { - _notifProc.command = ["busctl", "--user", "call", "org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications", "Notify", "susssasa{sv}i" // signature - , "nova-shell" // app_name - , "0" // replaces_id - , icon // app_icon - , summary // summary - , body // body - , "0" // actions (empty array) - , "1", "urgency", "y", String(urgency) // hints: urgency - , "-1" // expire_timeout - ]; - _notifProc.running = true; - } - - property var _notifProc: Process {} - function fmtTime(secs) { if (!secs || secs <= 0) return ""; diff --git a/test/qmllint-baseline.txt b/test/qmllint-baseline.txt index ff9ca29..f3c778e 100644 --- a/test/qmllint-baseline.txt +++ b/test/qmllint-baseline.txt @@ -84,7 +84,6 @@ shell/modules/WeatherModule.qml: Unqualified access [unqualified] shell/modules/WindowTitleModule.qml: Unqualified access [unqualified] shell/modules/WorkspacesModule.qml: Member "screen" not found on type "QObject" [missing-property] shell/modules/WorkspacesModule.qml: Unqualified access [unqualified] -shell/services/BatteryService.qml: Unqualified access [unqualified] shell/services/BluetoothService.qml: Unqualified access [unqualified] shell/services/LockService.qml: Type QProcess::ExitStatus of parameter exitStatus in signal called exited was not found, but is required to compile onExited. Did you add all imports and dependencies? [signal-handler-parameters] shell/services/LockService.qml: Unqualified access [unqualified]