dots-of-war/eww-laptop/.config/eww/eww.yuck
2023-03-26 10:55:59 +02:00

31 lines
1.2 KiB
Text

(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
(deflisten current_workspace :initial "1" "bash ~/.config/eww/scripts/get-active-workspace")
(defpoll time :interval "1s" "date '+%d.%m.%Y - %H:%M'")
(defwidget workspaces []
(eventbox :halign "start"
:onscroll "bash ${EWW_CONFIG_DIR}/scripts/change-active-workspace {} ${current_workspace}"
:class "workspaces-widget"
(box :space-evenly true
(for workspace in workspaces
(eventbox :onclick "hyprctl dispatch workspace ${workspace.id}"
(box :class "workspace-entry ${workspace.id == current_workspace ? "current" : ""} ${workspace.windows > 0 ? "occupied" : "empty"}"
(label :text " ${workspace.id == current_workspace ? "◆" : "◇"} ")))))))
(defwidget bar []
(centerbox :class "bar"
(workspaces)
"${time}"
(box :halign "end"
:space-evenly true
:width "150"
"󰁹 ${EWW_BATTERY["BAT1"].capacity}%"
"󰍛 ${round(EWW_RAM.used_mem_perc, 0)}%"
"󰻠 ${round(EWW_CPU.avg, 0)}%")))
(defwindow bar
:monitor 0
:geometry (geometry :x 0 :y 0 :width "100%" :height "30px" :anchor "top center")
:stacking "fg"
:exclusive true
(bar))