(deflisten activewindow :initial "..." "hyprman -a 2>>/tmp/eww_hyprman_activewindow.log")

(defvar windowIcons 
  `{
     "generic": "",
     "spotify": "",
     "mpv": "",
     "firefox": "",
     "chromium": "",
     "zen": "",
     "Alacritty": "",
     "steam": "󰓓",
     "discord": "󰙯"
  }`)

(defwidget windowIcon []
  (image
    :icon-size: 12
    :icon {activewindow.class}))

(defwidget hypr_active_window []
  (tooltip
    (label :text {activewindow.title})
    (box
      :class "activewindow${activewindow.xwayland == true ? '--xwayland' : ''}"
      :halign "left"
      :valign "center"
      :spacing 3
      (label 
        :limit-width 25
        :unindent true
        :text "${windowIcons[activewindow.class] ?: windowIcons['generic']}  ${activewindow.class}"))))
