(defwidget cavacol_musicwin [nth dir]
  (box
    :valign "${dir == 'up' ? 'end' : (
      dir == 'down' ? 'start' : (
        dir == 'virt' ? 'center' : 'fill'
      )
    )}"
    :halign "${dir == 'right' ? 'start' : (
      dir == 'left' ? 'end' : (
        dir == 'hori' ? 'center' : 'fill'
      )
    )}"
    :width 15
    :class "cava_column"
    :style "
    transition: 0ms;
    min-height: ${cavajson[nth]/7}px;
    "
  )
)

(defwidget desktop_cava []
    (box :class "desktop_cava" :space-evenly true :orientation "h"
        (cavacol_musicwin :dir "up" :nth 0)
        (cavacol_musicwin :dir "up" :nth 1)
        (cavacol_musicwin :dir "up" :nth 2)
        (cavacol_musicwin :dir "up" :nth 3)
        (cavacol_musicwin :dir "up" :nth 4)
        (cavacol_musicwin :dir "up" :nth 5)
        (cavacol_musicwin :dir "up" :nth 6)
        (cavacol_musicwin :dir "up" :nth 7)
        (cavacol_musicwin :dir "up" :nth 8)
        (cavacol_musicwin :dir "up" :nth 9)
        (cavacol_musicwin :dir "up" :nth 10)
        (cavacol_musicwin :dir "up" :nth 11)
        (cavacol_musicwin :dir "up" :nth 12)
        (cavacol_musicwin :dir "up" :nth 13)
        (cavacol_musicwin :dir "up" :nth 14)
        (cavacol_musicwin :dir "up" :nth 15)
        (cavacol_musicwin :dir "up" :nth 16)
        (cavacol_musicwin :dir "up" :nth 17)
        (cavacol_musicwin :dir "up" :nth 18)
        (cavacol_musicwin :dir "up" :nth 19)
    )
)
