(defwindow bar [monitor] :monitor monitor :windowtype "dock" :geometry (geometry :x "0%" :y "1%" :width "99%" :height "20px" :anchor "top center") :exclusive true (bar :monitor_ monitor)) (defwidget bar [monitor_] (centerbox :orientation "h" (workspaceWidget :monitor monitor_) (music) (sidestuff))) (defwidget sidestuff [] (box :class "sidestuff" :orientation "h" :space-evenly false :halign "end" (metric :label "󰓃" :value volume :onchange "amixer -D pulse sset Master {}%") (metric :label "" :value {EWW_RAM.used_mem_perc} :onchange "") (metric :label "" :value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)} :onchange "") (clock) )) (defwidget music [] (box :class "music" :orientation "h" :space-evenly false :halign "center" {music != "" ? "🎵${music}" : ""})) (defwidget metric [label value onchange] (box :orientation "h" :class "metric" :space-evenly false (box :class "label" label) (scale :min 0 :max 101 :active {onchange != ""} :value value :onchange onchange))) (deflisten workspaces "hyprland-workspaces _") (defwidget workspaceWidget [monitor] (eventbox :onscroll "hyprctl dispatch workspace `echo {} | sed 's/up/+/\' | sed 's/down/-/'`1" (box :class "workspaces" :space-evenly false :width 20 (for i in {workspaces[monitor].workspaces} (button :onclick "hyprctl dispatch workspace ${i.id}" :class "${i.class}" "${i.name}"))))) (deflisten workspace-old "scripts/workspace") (defwidget workspaces-old [] (literal :content workspace-old)) (deflisten music :initial "" "playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true") (defpoll volume :interval "1s" "scripts/getvol") (defpoll time :interval "1s" "date '+%H:%M:%S | %d.%m.%Y'") (defwidget clock [] (box :class "clock" (label :text time) ) )