diff --git a/.config/quickshell/modules/bar/UtilButtons.qml b/.config/quickshell/modules/bar/UtilButtons.qml index 48bdab096..a893fe1ad 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 @@ -21,48 +22,68 @@ Rectangle { spacing: 4 anchors.centerIn: parent - 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 + 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") + 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") + Loader { + active: ConfigOptions.bar.utilButtons.showColorPicker + visible: 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 + } + } + } - // 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") - - MaterialSymbol { - horizontalAlignment: Qt.AlignHCenter - fill: 0 - text: "keyboard" - iconSize: Appearance.font.pixelSize.large - color: Appearance.colors.colOnLayer2 + Loader { + active: ConfigOptions.bar.utilButtons.showKeyboardToggle + visible: 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 + } } - } + 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") + MaterialSymbol { + horizontalAlignment: Qt.AlignHCenter + fill: 0 + text: Pipewire.defaultAudioSource?.audio?.muted ? "mic_off" : "mic" + iconSize: Appearance.font.pixelSize.large + color: Appearance.colors.colOnLayer2 + } + } + } } - } diff --git a/.config/quickshell/modules/common/ConfigOptions.qml b/.config/quickshell/modules/common/ConfigOptions.qml index 470f438df..18d3b5874 100644 --- a/.config/quickshell/modules/common/ConfigOptions.qml +++ b/.config/quickshell/modules/common/ConfigOptions.qml @@ -45,6 +45,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