mirror of
https://github.com/tuxdotrs/tpanel.git
synced 2026-09-19 18:19:02 +05:30
feat(bar): add audio indicator widget
This commit is contained in:
24
services/Audio.qml
Normal file
24
services/Audio.qml
Normal file
@@ -0,0 +1,24 @@
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Services.Pipewire
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
readonly property string outputName: root.displayName(Pipewire.defaultAudioSink)
|
||||
readonly property string inputName: root.displayName(Pipewire.defaultAudioSource)
|
||||
readonly property url outputIcon: `${Quickshell.shellPath("assets")}/icons/speaker.svg`
|
||||
readonly property url inputIcon: `${Quickshell.shellPath("assets")}/icons/microphone.svg`
|
||||
|
||||
function displayName(node: PwNode): string {
|
||||
if (!node)
|
||||
return "none";
|
||||
return node.description || node.name;
|
||||
}
|
||||
|
||||
PwObjectTracker {
|
||||
objects: [Pipewire.defaultAudioSink, Pipewire.defaultAudioSource]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user