diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index c8502d3..b9d2ee8 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -17,7 +17,9 @@ PanelWindow { id: leftLayout anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter - Workspaces {} + Workspaces { + Layout.leftMargin: 10 + } } RowLayout { diff --git a/modules/bar/Volume.qml b/modules/bar/Volume.qml index 903296a..587b7a7 100644 --- a/modules/bar/Volume.qml +++ b/modules/bar/Volume.qml @@ -1,6 +1,7 @@ import QtQuick import Quickshell.Services.Pipewire import Quickshell.Widgets +import Quickshell.Io Item { id: root @@ -8,7 +9,23 @@ Item { implicitHeight: volRow.implicitHeight // grab the default speaker (Sink) property var sink: Pipewire.defaultAudioSink + Process { + id: pavu + command: ["pavucontrol"] // The command and args list + } + MouseArea { + cursorShape: Qt.OpenHandCursor + onClicked: mouse => { + if (mouse.button === Qt.LeftButton) { + // Left Click: Summon the Mixer! + console.log("Summoning Pavucontrol... Nya!"); + pavu.startDetached(); + } + } + anchors.fill: parent + // Scroll to change volume (The fancy stuff!) + } // Logic to pick the correct icon name function getVolumeIcon() { // Safety check: if Pipewire is dead or sink is missing @@ -57,24 +74,6 @@ Item { font.family: Appearance.font font.pixelSize: Appearance.fontSize text: Math.round(Pipewire.defaultAudioSink.audio.volume * 100) + "%" - MouseArea { - anchors.fill: parent - onClicked: { - if (root.sink) { - root.sink.audio.muted = !root.sink.audio.muted; - } - } - // Scroll to change volume (The fancy stuff!) - onWheel: wheel => { - if (root.sink) { - if (wheel.angleDelta.y > 0) { - root.sink.audio.volume += 0.05; // Up 5% - } else { - root.sink.audio.volume -= 0.05; // Down 5% - } - } - } - } } // Click to toggle mute! (Bonus feature) diff --git a/modules/bar/Workspaces.qml b/modules/bar/Workspaces.qml index dd38a80..f4ff34c 100644 --- a/modules/bar/Workspaces.qml +++ b/modules/bar/Workspaces.qml @@ -1,14 +1,13 @@ - - import Quickshell.Hyprland import QtQuick import QtQuick.Layouts Item { id: root - implicitWidth: workspaceRepeater.count * 30 + implicitWidth: workspaceRow.implicitWidth height: 30 Row { + id: workspaceRow anchors.centerIn: parent spacing: 10 // Slightly increase spacing between workspace buttons @@ -17,8 +16,9 @@ Item { model: Hyprland.workspaces Rectangle { - width: 20 - height: 20 + id: workspaceCircle + width: 16 + height: 16 radius: 20 //color: modelData.active ? myPallete.accent : myPallete.window color: modelData.active ? Colors.foreground : "transparent"