From 25dba608ae7ae4f122dbc0d2a892f30c6c5a181c Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 8 Mar 2026 19:58:37 +0100 Subject: [PATCH] hefty: bar: systeminfo: add to default bar config, add ppd btns --- .../ii/modules/common/config/HeftyConfig.qml | 2 +- .../common/widgets/ConfigSelectionArray.qml | 5 +++ .../topLayer/bar/widgets/HSystemInfo.qml | 37 ++++++++++++++++++- 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/common/config/HeftyConfig.qml b/dots/.config/quickshell/ii/modules/common/config/HeftyConfig.qml index 131e04e41..efe35cf33 100644 --- a/dots/.config/quickshell/ii/modules/common/config/HeftyConfig.qml +++ b/dots/.config/quickshell/ii/modules/common/config/HeftyConfig.qml @@ -7,7 +7,7 @@ JsonObject { property list leftWidgets: ["HWindowInfo"] property list centerLeftWidgets: ["HTime"] property list centerWidgets: ["HWorkspaces"] - property list centerRightWidgets: ["HBattery"] + property list centerRightWidgets: ["HSystemInfo"] property list rightWidgets: [] property bool m3ExpressiveGrouping: true } diff --git a/dots/.config/quickshell/ii/modules/common/widgets/ConfigSelectionArray.qml b/dots/.config/quickshell/ii/modules/common/widgets/ConfigSelectionArray.qml index dd102070c..95f22a9e0 100644 --- a/dots/.config/quickshell/ii/modules/common/widgets/ConfigSelectionArray.qml +++ b/dots/.config/quickshell/ii/modules/common/widgets/ConfigSelectionArray.qml @@ -23,6 +23,10 @@ Flow { ] property var currentValue: null + function focusSelectedChild() { + children.find(c => c.value == currentValue).forceActiveFocus() + } + signal selected(var newValue) Repeater { @@ -31,6 +35,7 @@ Flow { id: paletteButton required property var modelData required property int index + readonly property var value: modelData.value onYChanged: { if (index === 0) { paletteButton.leftmost = true diff --git a/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HSystemInfo.qml b/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HSystemInfo.qml index a3e81902d..62fa558c1 100644 --- a/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HSystemInfo.qml +++ b/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HSystemInfo.qml @@ -136,12 +136,19 @@ HBarWidgetWithPopout { } component SysInfoPopupContent: W.ChoreographerGridLayout { + id: popupRoot + rowSpacing: 8 + + onShownChanged: { + if (shown) { + powerProfileSelection.focusSelectedChild() + } + } W.FlyFadeEnterChoreographable { Layout.fillWidth: true RowLayout { - anchors.fill: parent spacing: 10 W.CircularProgress { @@ -198,6 +205,34 @@ HBarWidgetWithPopout { } } } + + W.FlyFadeEnterChoreographable { + Layout.fillWidth: true + W.ConfigSelectionArray { + id: powerProfileSelection + currentValue: PowerProfiles.profile + onSelected: newValue => { + PowerProfiles.profile = newValue + } + options: [ + { + displayName: S.Translation.tr("Power saver"), + // icon: "line_curve", + value: PowerProfile.PowerSaver + }, + { + displayName: S.Translation.tr("Balanced"), + // icon: "page_header", + value: PowerProfile.Balanced + }, + { + displayName: S.Translation.tr("Performance"), + // icon: "toolbar", + value: PowerProfile.Performance + } + ] + } + } } component StatWithIcon: Item {