From 220949a29316c3f72a4988724669f68a17817545 Mon Sep 17 00:00:00 2001 From: bean-factory <76696071+bean-factory@users.noreply.github.com> Date: Sat, 3 Jan 2026 17:28:50 +0000 Subject: [PATCH] Add function to cycle power profiles in reverse order --- Modules/Bar/Widgets/PowerProfile.qml | 1 + Services/Control/IPCService.qml | 4 ++++ Services/Power/PowerProfileService.qml | 12 ++++++++++++ 3 files changed, 17 insertions(+) diff --git a/Modules/Bar/Widgets/PowerProfile.qml b/Modules/Bar/Widgets/PowerProfile.qml index a23240898..396cd7d17 100644 --- a/Modules/Bar/Widgets/PowerProfile.qml +++ b/Modules/Bar/Widgets/PowerProfile.qml @@ -28,4 +28,5 @@ NIconButton { border.color: Style.capsuleBorderColor border.width: Style.capsuleBorderWidth onClicked: PowerProfileService.cycleProfile() + onRightClicked: PowerProfileService.cycleProfileReverse() } diff --git a/Services/Control/IPCService.qml b/Services/Control/IPCService.qml index 8d2107c62..ee49ffb1a 100644 --- a/Services/Control/IPCService.qml +++ b/Services/Control/IPCService.qml @@ -392,6 +392,10 @@ Item { PowerProfileService.cycleProfile(); } + function cycleReverse() { + PowerProfileService.cycleProfileReverse(); + } + function set(mode: string) { switch (mode) { case "performance": diff --git a/Services/Power/PowerProfileService.qml b/Services/Power/PowerProfileService.qml index 68037318c..89d4e2fd8 100644 --- a/Services/Power/PowerProfileService.qml +++ b/Services/Power/PowerProfileService.qml @@ -78,6 +78,18 @@ Singleton { setProfile(PowerProfile.Balanced); } + function cycleProfileReverse() { + if (!available) + return; + const current = powerProfiles.profile; + if (current === PowerProfile.Performance) + setProfile(PowerProfile.Balanced); + else if (current === PowerProfile.Balanced) + setProfile(PowerProfile.PowerSaver); + else if (current === PowerProfile.PowerSaver) + setProfile(PowerProfile.Performance); + } + function isDefault() { if (!available) return true;