From aa951b0bc089153632b6d52b284d35f968b8f810 Mon Sep 17 00:00:00 2001 From: _xB <65196493+xBiei@users.noreply.github.com> Date: Fri, 6 Jun 2025 01:12:11 +0300 Subject: [PATCH 1/7] bar: add microphone control to util buttons --- .config/quickshell/modules/bar/UtilButtons.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.config/quickshell/modules/bar/UtilButtons.qml b/.config/quickshell/modules/bar/UtilButtons.qml index 48bdab096..d2705865c 100644 --- a/.config/quickshell/modules/bar/UtilButtons.qml +++ b/.config/quickshell/modules/bar/UtilButtons.qml @@ -5,6 +5,7 @@ import QtQuick.Layouts import Quickshell import Quickshell.Io import Quickshell.Hyprland +import Quickshell.Services.Pipewire Rectangle { id: root @@ -63,6 +64,20 @@ Rectangle { } + CircleUtilButton { + Layout.alignment: Qt.AlignVCenter + onClicked: Hyprland.dispatch("exec wpctl set-mute @DEFAULT_SOURCE@ toggle") + + MaterialSymbol { + horizontalAlignment: Qt.AlignHCenter + fill: 0 + text: Pipewire.defaultAudioSource?.audio?.muted ? "mic_off" : "mic" + iconSize: Appearance.font.pixelSize.large + color: Appearance.colors.colOnLayer2 + } + + } + } } From 60c93fd2ee7dad44a584f335bb3fd04804fa78ff Mon Sep 17 00:00:00 2001 From: _xB <65196493+xBiei@users.noreply.github.com> Date: Thu, 12 Jun 2025 05:43:36 +0300 Subject: [PATCH 2/7] Add the utilButtons config options --- .config/quickshell/modules/common/ConfigOptions.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.config/quickshell/modules/common/ConfigOptions.qml b/.config/quickshell/modules/common/ConfigOptions.qml index 91ba70408..842fe66ce 100644 --- a/.config/quickshell/modules/common/ConfigOptions.qml +++ b/.config/quickshell/modules/common/ConfigOptions.qml @@ -36,6 +36,12 @@ Singleton { property bool alwaysShowSwap: true property bool alwaysShowCpu: false } + property QtObject utilButtons: QtObject { + property bool showMicToggle: true + property bool showKeyboardToggle: true + property bool showScreenSnip: true + // property bool showColorPicker: true + } property QtObject workspaces: QtObject { property int shown: 10 property bool alwaysShowNumbers: false From c3fa00b5c651e520ee6086b7dc41ccfc64e563a3 Mon Sep 17 00:00:00 2001 From: _xB <65196493+xBiei@users.noreply.github.com> Date: Thu, 12 Jun 2025 05:45:22 +0300 Subject: [PATCH 3/7] bar: add visibility options to utilButtons --- .config/quickshell/modules/bar/UtilButtons.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.config/quickshell/modules/bar/UtilButtons.qml b/.config/quickshell/modules/bar/UtilButtons.qml index d2705865c..51f6e728c 100644 --- a/.config/quickshell/modules/bar/UtilButtons.qml +++ b/.config/quickshell/modules/bar/UtilButtons.qml @@ -25,6 +25,7 @@ Rectangle { CircleUtilButton { Layout.alignment: Qt.AlignVCenter onClicked: Hyprland.dispatch("exec hyprshot --freeze --clipboard-only --mode region --silent") + visible: ConfigOptions.bar.utilButtons.showScreenSnip MaterialSymbol { horizontalAlignment: Qt.AlignHCenter @@ -39,6 +40,7 @@ Rectangle { // CircleUtilButton { // Layout.alignment: Qt.AlignVCenter // onClicked: Hyprland.dispatch("exec hyprpicker -a") + // visible: ConfigOptions.bar.utilButtons.showColorPicker // MaterialSymbol { // horizontalAlignment: Qt.AlignHCenter @@ -47,12 +49,12 @@ Rectangle { // iconSize: Appearance.font.pixelSize.large // color: Appearance.colors.colOnLayer2 // } - // } CircleUtilButton { Layout.alignment: Qt.AlignVCenter onClicked: Hyprland.dispatch("global quickshell:oskToggle") + visible: ConfigOptions.bar.utilButtons.showKeyboardToggle MaterialSymbol { horizontalAlignment: Qt.AlignHCenter @@ -67,6 +69,7 @@ Rectangle { CircleUtilButton { Layout.alignment: Qt.AlignVCenter onClicked: Hyprland.dispatch("exec wpctl set-mute @DEFAULT_SOURCE@ toggle") + visible: ConfigOptions.bar.utilButtons.showMicToggle && Pipewire.defaultAudioSource?.audio MaterialSymbol { horizontalAlignment: Qt.AlignHCenter From af409dc0c9cbf7d5436fd342532d75f270b9b3bc Mon Sep 17 00:00:00 2001 From: _xB <65196493+xBiei@users.noreply.github.com> Date: Thu, 12 Jun 2025 09:01:25 +0300 Subject: [PATCH 4/7] bar: wrap buttons in Loaders --- .../quickshell/modules/bar/UtilButtons.qml | 97 +++++++++---------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/.config/quickshell/modules/bar/UtilButtons.qml b/.config/quickshell/modules/bar/UtilButtons.qml index 51f6e728c..73b44a58d 100644 --- a/.config/quickshell/modules/bar/UtilButtons.qml +++ b/.config/quickshell/modules/bar/UtilButtons.qml @@ -22,65 +22,64 @@ Rectangle { spacing: 4 anchors.centerIn: parent - CircleUtilButton { - Layout.alignment: Qt.AlignVCenter - onClicked: Hyprland.dispatch("exec hyprshot --freeze --clipboard-only --mode region --silent") - visible: ConfigOptions.bar.utilButtons.showScreenSnip - - MaterialSymbol { - horizontalAlignment: Qt.AlignHCenter - fill: 1 - text: "screenshot_region" - iconSize: Appearance.font.pixelSize.large - color: Appearance.colors.colOnLayer2 + Loader { + active: ConfigOptions.bar.utilButtons.showScreenSnip + sourceComponent: CircleUtilButton { + Layout.alignment: Qt.AlignVCenter + onClicked: Hyprland.dispatch("exec hyprshot --freeze --clipboard-only --mode region --silent") + MaterialSymbol { + horizontalAlignment: Qt.AlignHCenter + fill: 1 + text: "screenshot_region" + iconSize: Appearance.font.pixelSize.large + color: Appearance.colors.colOnLayer2 + } } - } - // CircleUtilButton { - // Layout.alignment: Qt.AlignVCenter - // onClicked: Hyprland.dispatch("exec hyprpicker -a") - // visible: ConfigOptions.bar.utilButtons.showColorPicker - - // MaterialSymbol { - // horizontalAlignment: Qt.AlignHCenter - // fill: 1 - // text: "colorize" - // iconSize: Appearance.font.pixelSize.large - // color: Appearance.colors.colOnLayer2 + // Loader { + // active: ConfigOptions.bar.utilButtons.showColorPicker + // sourceComponent: CircleUtilButton { + // Layout.alignment: Qt.AlignVCenter + // onClicked: Hyprland.dispatch("exec hyprpicker -a") + // MaterialSymbol { + // horizontalAlignment: Qt.AlignHCenter + // fill: 1 + // text: "colorize" + // iconSize: Appearance.font.pixelSize.large + // color: Appearance.colors.colOnLayer2 + // } // } // } - CircleUtilButton { - Layout.alignment: Qt.AlignVCenter - onClicked: Hyprland.dispatch("global quickshell:oskToggle") - visible: ConfigOptions.bar.utilButtons.showKeyboardToggle - - MaterialSymbol { - horizontalAlignment: Qt.AlignHCenter - fill: 0 - text: "keyboard" - iconSize: Appearance.font.pixelSize.large - color: Appearance.colors.colOnLayer2 + Loader { + active: ConfigOptions.bar.utilButtons.showKeyboardToggle + sourceComponent: CircleUtilButton { + Layout.alignment: Qt.AlignVCenter + onClicked: Hyprland.dispatch("global quickshell:oskToggle") + MaterialSymbol { + horizontalAlignment: Qt.AlignHCenter + fill: 0 + text: "keyboard" + iconSize: Appearance.font.pixelSize.large + color: Appearance.colors.colOnLayer2 + } } - } - CircleUtilButton { - Layout.alignment: Qt.AlignVCenter - onClicked: Hyprland.dispatch("exec wpctl set-mute @DEFAULT_SOURCE@ toggle") - visible: ConfigOptions.bar.utilButtons.showMicToggle && Pipewire.defaultAudioSource?.audio - - MaterialSymbol { - horizontalAlignment: Qt.AlignHCenter - fill: 0 - text: Pipewire.defaultAudioSource?.audio?.muted ? "mic_off" : "mic" - iconSize: Appearance.font.pixelSize.large - color: Appearance.colors.colOnLayer2 + Loader { + active: ConfigOptions.bar.utilButtons.showMicToggle + sourceComponent: CircleUtilButton { + Layout.alignment: Qt.AlignVCenter + onClicked: Hyprland.dispatch("exec wpctl set-mute @DEFAULT_SOURCE@ toggle") + MaterialSymbol { + horizontalAlignment: Qt.AlignHCenter + fill: 0 + text: Pipewire.defaultAudioSource?.audio?.muted ? "mic_off" : "mic" + iconSize: Appearance.font.pixelSize.large + color: Appearance.colors.colOnLayer2 + } } - } - } - } From f76fe3726914bf8f3c62cf4f904f858f5a16e53f Mon Sep 17 00:00:00 2001 From: _xB <65196493+xBiei@users.noreply.github.com> Date: Thu, 12 Jun 2025 13:51:03 +0300 Subject: [PATCH 5/7] bar: re-add color picker button --- .../quickshell/modules/bar/UtilButtons.qml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.config/quickshell/modules/bar/UtilButtons.qml b/.config/quickshell/modules/bar/UtilButtons.qml index 73b44a58d..6bc6be794 100644 --- a/.config/quickshell/modules/bar/UtilButtons.qml +++ b/.config/quickshell/modules/bar/UtilButtons.qml @@ -37,20 +37,20 @@ Rectangle { } } - // Loader { - // active: ConfigOptions.bar.utilButtons.showColorPicker - // sourceComponent: CircleUtilButton { - // Layout.alignment: Qt.AlignVCenter - // onClicked: Hyprland.dispatch("exec hyprpicker -a") - // MaterialSymbol { - // horizontalAlignment: Qt.AlignHCenter - // fill: 1 - // text: "colorize" - // iconSize: Appearance.font.pixelSize.large - // color: Appearance.colors.colOnLayer2 - // } - // } - // } + Loader { + active: ConfigOptions.bar.utilButtons.showColorPicker + sourceComponent: CircleUtilButton { + Layout.alignment: Qt.AlignVCenter + onClicked: Hyprland.dispatch("exec hyprpicker -a") + MaterialSymbol { + horizontalAlignment: Qt.AlignHCenter + fill: 1 + text: "colorize" + iconSize: Appearance.font.pixelSize.large + color: Appearance.colors.colOnLayer2 + } + } + } Loader { active: ConfigOptions.bar.utilButtons.showKeyboardToggle From 3767542bac3829db865da57d68f39f5436dd1fb4 Mon Sep 17 00:00:00 2001 From: _xB <65196493+xBiei@users.noreply.github.com> Date: Thu, 12 Jun 2025 13:51:48 +0300 Subject: [PATCH 6/7] bar: re-add color picker button config --- .config/quickshell/modules/common/ConfigOptions.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/quickshell/modules/common/ConfigOptions.qml b/.config/quickshell/modules/common/ConfigOptions.qml index 842fe66ce..8eded0387 100644 --- a/.config/quickshell/modules/common/ConfigOptions.qml +++ b/.config/quickshell/modules/common/ConfigOptions.qml @@ -40,7 +40,7 @@ Singleton { property bool showMicToggle: true property bool showKeyboardToggle: true property bool showScreenSnip: true - // property bool showColorPicker: true + property bool showColorPicker: true } property QtObject workspaces: QtObject { property int shown: 10 From 4c97434ccaa1823de5197ca1d047cb9cfd2c2e86 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 12 Jun 2025 15:33:27 +0200 Subject: [PATCH 7/7] util buttons: make buttons hide properly --- .config/quickshell/modules/bar/UtilButtons.qml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.config/quickshell/modules/bar/UtilButtons.qml b/.config/quickshell/modules/bar/UtilButtons.qml index 6bc6be794..a893fe1ad 100644 --- a/.config/quickshell/modules/bar/UtilButtons.qml +++ b/.config/quickshell/modules/bar/UtilButtons.qml @@ -24,6 +24,7 @@ Rectangle { Loader { active: ConfigOptions.bar.utilButtons.showScreenSnip + visible: ConfigOptions.bar.utilButtons.showScreenSnip sourceComponent: CircleUtilButton { Layout.alignment: Qt.AlignVCenter onClicked: Hyprland.dispatch("exec hyprshot --freeze --clipboard-only --mode region --silent") @@ -39,6 +40,7 @@ Rectangle { Loader { active: ConfigOptions.bar.utilButtons.showColorPicker + visible: ConfigOptions.bar.utilButtons.showColorPicker sourceComponent: CircleUtilButton { Layout.alignment: Qt.AlignVCenter onClicked: Hyprland.dispatch("exec hyprpicker -a") @@ -54,6 +56,7 @@ Rectangle { Loader { active: ConfigOptions.bar.utilButtons.showKeyboardToggle + visible: ConfigOptions.bar.utilButtons.showKeyboardToggle sourceComponent: CircleUtilButton { Layout.alignment: Qt.AlignVCenter onClicked: Hyprland.dispatch("global quickshell:oskToggle") @@ -69,6 +72,7 @@ Rectangle { Loader { active: ConfigOptions.bar.utilButtons.showMicToggle + visible: ConfigOptions.bar.utilButtons.showMicToggle sourceComponent: CircleUtilButton { Layout.alignment: Qt.AlignVCenter onClicked: Hyprland.dispatch("exec wpctl set-mute @DEFAULT_SOURCE@ toggle")