(defwidget active_window []
  (box :orientation "h"
    :halign "end"
    :space-evenly false
    :class "active_window"
    {active_window_name == "" ? "" : "${active_window_name}: ${active_window_title}"}))

(defpoll active_window_name :interval "1s" "hyprctl activewindow | awk 'FNR==9{print substr($0,9)}'")

(defpoll active_window_title :interval "1s" "hyprctl activewindow | awk 'FNR==10{print substr($0,9,40)}'")
