44 lines
1.2 KiB
Plaintext
44 lines
1.2 KiB
Plaintext
|
(defwidget audio-sink [sink]
|
||
|
(box
|
||
|
:orientation "v"
|
||
|
(box :space-evenly false :spacing 15
|
||
|
(box "${sink.id == audio_sink_default ? "x " : ""}${sink.name}")
|
||
|
(box :hexpand true)
|
||
|
(button :onclick "pactl set-sink-mute \"${sink.id}\" toggle"
|
||
|
"M")
|
||
|
(button :onclick "pactl set-default-sink ${sink.id}"
|
||
|
"D")
|
||
|
)
|
||
|
(box :space-evenly false
|
||
|
(box :width 50
|
||
|
{sink.muted ? "Muted" : "${sink.volume}%"})
|
||
|
(scale :hexpand true
|
||
|
:value {sink.volume}
|
||
|
:onchange "pactl set-sink-volume ${sink.id} {}%"
|
||
|
)
|
||
|
)
|
||
|
)
|
||
|
)
|
||
|
|
||
|
(defwidget audio-source [source]
|
||
|
(box
|
||
|
:orientation "v"
|
||
|
(box :space-evenly false :spacing 15
|
||
|
(box "${source.id == audio_source_default ? "x " : ""}${source.name}")
|
||
|
(box :hexpand true)
|
||
|
(button :onclick "pactl set-source-mute \"${source.id}\" toggle"
|
||
|
"M")
|
||
|
(button :onclick "pactl set-default-source ${source.id}"
|
||
|
"D")
|
||
|
)
|
||
|
(box :space-evenly false
|
||
|
(box :width 50
|
||
|
{source.muted ? "Muted" : "${source.volume}%"})
|
||
|
(scale :hexpand true
|
||
|
:value {source.volume}
|
||
|
:onchange "pactl set-source-volume ${source.id} {}%"
|
||
|
)
|
||
|
)
|
||
|
)
|
||
|
)
|