dots-of-war/eww-laptop/.config/eww/eww.yuck

35 lines
1.2 KiB
Text
Raw Normal View History

2023-03-16 16:35:34 +00:00
(deflisten workspaces :initial "[]" "bash ./scripts/get-workspaces")
(deflisten current_workspace :initial "1" "bash ./scripts/get-active-workspace")
2023-03-16 16:26:29 +00:00
(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}"
2023-03-16 16:35:34 +00:00
(label :class {workspace.id == current_workspace ? "current" : ""}
:text " ${workspace.windows > 0 ? "◆" : "◇"} "))))))
2023-03-16 16:26:29 +00:00
(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))
2024-01-28 11:48:42 +00:00
(defwindow test [a id] :monitor {a} :geometry (geometry :x 0 :y 0 :width "50px" :height "50px" :anchor "top center")
"${a} ${id}")