Files
colorshell/eww/widgets/bar/audio.yuck
T
2024-12-07 16:43:37 -03:00

16 lines
747 B
Plaintext

(deflisten json_audio :initial `{ "output": 35, "source": 80 }`
`sh ./scripts/get-volume-watch.sh`)
(defwidget audio []
(eventbox :onclick "eww open --toggle audio-popup"
:class "audio-eventbox"
(box :class "audio"
(eventbox :onscroll `[ {} == "up" ] && wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ || wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-`
(label :text "${ json_audio.output != 0 ? '󰕾' : '󰝟' } ${json_audio.output}%"))
(eventbox :onscroll `[ {} == "up" ] && wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 5%+ || wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 5%-`
(label :text "${ json_audio.source != 0 ? '󰍬' : '󰍭' } ${json_audio.source}%"))
)
)
)