added audio to qs && nix flake update

This commit is contained in:
2026-03-14 15:36:48 +00:00
parent ccd6b38184
commit 7a1caeaaa3
4 changed files with 64 additions and 29 deletions

View File

@@ -0,0 +1,35 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Services.UPower
import Quickshell.Services.Pipewire
Rectangle {
id: root
property PwNode defaultSpeaker: Pipewire.preferredDefaultAudioSink
property PwNode defaultMic: Pipewire.defaultAudioSource
PwObjectTracker {
objects: [root.defaultSpeaker, root.defaultMic]
}
implicitHeight: 20
implicitWidth: content.width
color: Colors.backgroundAlt
Layout.alignment: Qt.AlignCenter
radius: 3.5
RowLayout {
id: content
height: 20
anchors.centerIn: parent
Text {
id: speaker
text: root.defaultSpeaker.audio.muted ? "muted" : "unmuted"
color: Colors.textPrimary
}
Text {
id: mic
text: root.defaultMic.audio.muted ? "muted" : "unmuted"
color: Colors.textPrimary
}
}
}

View File

@@ -50,6 +50,7 @@ Scope {
Layout.preferredHeight: 20
// spacing: 100
spacing: 10
Audio {}
BatteryWidget {}
Rectangle {
implicitWidth: clockText.width

View File

@@ -13,7 +13,6 @@ Singleton {
if (x.id == id) {
return x;
}
print(x);
}
return null;
}