Files
illogical-impulse/early/.config/eww/modules/audiolevels.yuck
T
2024-02-22 15:35:06 +07:00

71 lines
2.1 KiB
Plaintext
Executable File

(defwidget audiolevels[]
(box
:space-evenly false
:orientation "v"
:class "sliders"
(label
:text "Volume mixer"
:xalign 0
:style "font-weight: bold;"
)
(for i in audiojson
(eventbox
:onscroll "pactl set-sink-input-volume ${i.sink} $(echo {} | sed -e \"s/up/+10/g\" -e \"s/down/-10/g\")% &"
:onrightclick "pactl set-sink-input-volume ${i.sink} 100%"
(box
:space-evenly false
:orientation "v"
; (label :class "time" :text "DEBUG:${i}")
(centerbox
:space-evenly false
:orientation "h"
; :halign "center"
(label
:xalign 0
:class "audiotext"
:limit-width 42
:style "font-size: 13pt; padding-bottom: 2px;"
:text "${i.name} (#${i.sink})"
)
(label
:xalign 0
:class "audiotext"
:limit-width 30
:style "font-size: 13pt; padding-bottom: 2px;"
:text ""
)
(box :orientation "v"
(label
:xalign 1
:class "audiotext"
:style "font-size: 13pt; padding-bottom: 2px;"
:text "${i.volume}%"
)
)
)
(box
:class "volume-slider-box"
:space-evenly false
(eventbox
; :class "volume-icon"
:onclick "pactl set-sink-input-volume ${i.sink} 0%"
:onscroll "pactl set-sink-input-volume ${i.sink} $(echo {} | sed -e \"s/up/+10/g\" -e \"s/down/-10/g\")%"
:onrightclick "pactl set-sink-input-volume ${i.sink} 100%"
(label
:style "font-family: 'Material Symbols Rounded';"
:text "${volume.icon}"
)
)
(scale
:class "sliderbg"
:value {i.volume}
:class "volume-bar slider"
:onchange "pactl set-sink-input-volume ${i.sink} {}%"
:tooltip "${i.name}: ${i.volume}%"
)
)
)
)
)
)
)