make pw launch pavucontrol on click

This commit is contained in:
lucy 2026-05-19 12:37:37 +02:00
commit 7160655e78

View file

@ -1,5 +1,5 @@
import Quickshell.Services.Pipewire
import Quickshell.Widgets
import Quickshell.Io
import QtQuick
import QtQuick.Layouts
import qs
@ -8,7 +8,7 @@ import qs.settings
Rectangle {
id: root
color: Colors.base01
color: clickHandler.containsMouse ? Colors.base02 : Colors.base01
property PwNode defaultAudio: Pipewire.ready ? Pipewire.preferredDefaultAudioSink : null
property bool mute: Pipewire.ready ? defaultAudio?.audio.muted : null
radius: Config.rounding
@ -34,6 +34,12 @@ Rectangle {
objects: [Pipewire.ready ? Pipewire.defaultAudioSink : null]
}
Process {
id: pavuLauncher
command: ["pavucontrol"]
running: false
}
RowLayout {
id: pwLayout
anchors.centerIn: root
@ -47,4 +53,12 @@ Rectangle {
opacity: root.defaultAudio?.audio.muted ? 0.6 : 1.0
}
}
MouseArea {
id: clickHandler
hoverEnabled: true
acceptedButtons: Qt.LeftButton
cursorShape: Qt.PointingHandCursor
anchors.fill: root
onClicked: pavuLauncher.running = true
}
}