(defpoll brightness
  :interval "30ms"
  `brightnessctl g | awk -v max=$(brightnessctl m) '{print int($1/max * 100)}'`)

(defwidget brightness []
  (box :orientation "h" :halign "center" :valign "center" :space-evenly false :spacing 15 
    (label :class "label" :text "")
    (label :class "label" :text brightness)
    (progress :class "progress" :value brightness :valign "center" :width 275)))

(defwindow brightnessWin
  :class "brightnessWin"
  :monitor 0
  :geometry (geometry 
    :x "0%"
    :y "50px"
    :width "20%"
    :height "50px"
    :anchor "bottom center")
  :stacking "fg"
  (brightness))
