(defwidget volume-module [] (box :class "module icon" (eventbox ; scroll over the icon to change volume ; low increment so that scrolling with a touchpad doesn't shatter your eardrums :onscroll "echo {} | sed -e 's/up/-/g' -e 's/down/+/g' | xargs -I% wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.005%" :onclick "pavucontrol &" ; open pavucontrol on click :onrightclick "scripts/volume mute SINK" ; toggle mute on right click (label :class "vol-icon" :tooltip "volume ${volume.percent}%" :text {volume.icon}))))