(defwidget bar [] (centerbox :orientation "v" :class "bar" (workspaces) "t1" (sidestuff))) (defwidget workspace-btn [n ?icon] (button :onclick "hyprctl dispatch 'workspace ${n}'" :halign "baseline" :hexpand true "${icon ?: n}")) (defwidget workspaces [] (box :class "workspaces" :orientation "v" :space-evenly true :valign "start" :halign "center" (workspace-btn :n 1 :icon "") (workspace-btn :n 2 :icon "") (workspace-btn :n 3 :icon "󰈹") (workspace-btn :n 4 :icon "󰭹") (workspace-btn :n 5 :icon "") (workspace-btn :n 6 :icon "") (workspace-btn :n 7 :icon "") (workspace-btn :n 8 :icon "") (workspace-btn :n 9 :icon ""))) (defwidget sidestuff [] (box :class "sidestuff" :orientation "v" :space-evenly false :spacing 10 :valign "end" (netstats :device "wlp2s0") (battery :device "BAT0") (clock))) (defwidget metric [icon ?font-size] (box :class "metric card" :orientation "v" (label :class "metric-icon" :style {font-size != "" ? "font-size: ${font-size}rem;" : ""} :text icon) (children))) (defwidget netstats [device] (box :class "netstats" :orientation "v" :space-evenly false :valign "end" :halign "center" device "up" {EWW_NET[device].NET_UP})) (defwidget battery [device] (metric :icon "bat" "${EWW_BATTERY[device].capacity}%")) (defwidget clock [] (box :class "card" :orientation "v" :valign "end" :spacing -3 {formattime(EWW_TIME, "%a")} {formattime(EWW_TIME, "%-d")} {formattime(EWW_TIME, "%-m")} {formattime(EWW_TIME, "%-y")})) (defwindow bar :monitor 0 :geometry (geometry :width "1.5%" :height "98%" :anchor "right center") :stacking "fg" :windowtype "dock" :exclusive true (bar))