fix(battery): reliably apply configured power profiles at shell startup

Port 1.5

(cherry picked from commit 400a18a8ed)
This commit is contained in:
purian23 authored and dms-ci[bot] committed 2026-08-02 23:02:00 +00:00
1 parent 7063448b80
commit 943ffb432c
1 file changed
+8 -1
+8 -1
View File
@@ -23,6 +23,13 @@ Singleton {
}
}
Connections {
target: typeof PowerProfiles !== "undefined" ? PowerProfiles : null
function onHasPerformanceProfileChanged() {
root.applyPowerProfile();
}
}
function applyPowerProfile() {
if (!batteryAvailable)
return;
@@ -32,7 +39,7 @@ Singleton {
const targetProfile = parseInt(profileValue);
if (isNaN(targetProfile) || PowerProfiles.profile === targetProfile)
return;
PowerProfiles.profile = targetProfile;
PowerProfileWatcher.applyProfile(targetProfile);
}
readonly property string preferredBatteryOverride: Quickshell.env("DMS_PREFERRED_BATTERY")