36 lines
726 B
QML
36 lines
726 B
QML
pragma Singleton
|
|
|
|
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Services.Pipewire
|
|
|
|
Item {
|
|
id: root
|
|
|
|
PwObjectTracker {
|
|
objects: [ Pipewire.defaultAudioSource ]
|
|
}
|
|
|
|
property var audioSource: Pipewire.defaultAudioSource
|
|
|
|
property bool exists: audioSource != null
|
|
property bool mute: audioSource?.audio?.muted ?? false
|
|
property real volume: Math.round((audioSource?.audio?.volume ?? 0) * 1000) / 10
|
|
|
|
property bool volumeChanged: false
|
|
|
|
Connections {
|
|
target: audioSource?.audio
|
|
|
|
function onVolumeChanged() {
|
|
root.volumeChanged = true;
|
|
hideTimer.restart();
|
|
}
|
|
}
|
|
|
|
Timer {
|
|
id: hideTimer
|
|
interval: 1000
|
|
onTriggered: root.volumeChanged = false
|
|
}
|
|
} |