diff --git a/.config/quickshell/ii/modules/bar/UtilButtons.qml b/.config/quickshell/ii/modules/bar/UtilButtons.qml index 706ba6f6b..f110c9435 100644 --- a/.config/quickshell/ii/modules/bar/UtilButtons.qml +++ b/.config/quickshell/ii/modules/bar/UtilButtons.qml @@ -104,5 +104,38 @@ Item { } } } + + Loader { + active: Config.options.bar.utilButtons.showPerfProfileToggle + visible: Config.options.bar.utilButtons.showPerfProfileToggle + sourceComponent: CircleUtilButton { + Layout.alignment: Qt.AlignVCenter + onClicked: event => { + if (PowerProfiles.hasPerformanceProfile) { + switch(PowerProfiles.profile) { + case PowerProfile.PowerSaver: PowerProfiles.profile = PowerProfile.Balanced + break; + case PowerProfile.Balanced: PowerProfiles.profile = PowerProfile.Performance + break; + case PowerProfile.Performance: PowerProfiles.profile = PowerProfile.PowerSaver + break; + } + } else { + PowerProfiles.profile = PowerProfiles.profile == PowerProfile.Balanced ? PowerProfile.PowerSaver : PowerProfile.Balanced + } + } + MaterialSymbol { + horizontalAlignment: Qt.AlignHCenter + fill: 0 + text: switch(PowerProfiles.profile) { + case PowerProfile.PowerSaver: return "battery_saver" + case PowerProfile.Balanced: return "balance" + case PowerProfile.Performance: return "speed" + } + iconSize: Appearance.font.pixelSize.large + color: Appearance.colors.colOnLayer2 + } + } + } } } diff --git a/.config/quickshell/ii/modules/common/Config.qml b/.config/quickshell/ii/modules/common/Config.qml index 582c11d8e..ea37b692a 100644 --- a/.config/quickshell/ii/modules/common/Config.qml +++ b/.config/quickshell/ii/modules/common/Config.qml @@ -123,6 +123,7 @@ Singleton { property bool showMicToggle: false property bool showKeyboardToggle: true property bool showDarkModeToggle: true + property bool showPerfProfileToggle: false } property JsonObject tray: JsonObject { property bool monochromeIcons: true diff --git a/.config/quickshell/ii/modules/settings/InterfaceConfig.qml b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml index 2d692442c..293b60321 100644 --- a/.config/quickshell/ii/modules/settings/InterfaceConfig.qml +++ b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml @@ -164,8 +164,11 @@ ContentPage { } } ConfigSwitch { - opacity: 0 - enabled: false + text: "Performance Profile toggle" + checked: Config.options.bar.utilButtons.showPerfProfileToggle + onCheckedChanged: { + Config.options.bar.utilButtons.showPerfProfileToggle = checked; + } } } }