1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00

power: support automatic profile switching on battery change (#897)

This commit is contained in:
Marcus Ramberg
2025-12-04 14:37:07 +01:00
committed by GitHub
parent 5b7302b46d
commit 08a97aeff8
4 changed files with 52 additions and 0 deletions

View File

@@ -72,6 +72,17 @@ Singleton {
}
}
const profileValue = BatteryService.isPluggedIn
? SettingsData.acProfileName
: SettingsData.batteryProfileName;
if (profileValue !== "") {
const targetProfile = parseInt(profileValue);
if (!isNaN(targetProfile) && PowerProfiles.profile !== targetProfile) {
PowerProfiles.profile = targetProfile;
}
}
previousPluggedState = isPluggedIn;
}