mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-12-27 06:32:23 +00:00
43 lines
1.3 KiB
Text
43 lines
1.3 KiB
Text
(deflisten workspaces :initial "[]" "bash ./scripts/get-workspaces")
|
|
(deflisten current_workspace :initial "1" "bash ./scripts/get-active-workspace")
|
|
(defpoll time :interval "1s" "date '+%d.%m.%Y - %H:%M:%S'")
|
|
|
|
(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}"
|
|
(label :class {workspace.id == current_workspace ? "current" : ""}
|
|
:text " ${workspace.windows > 0 ? "◆" : "◇"} "))))))
|
|
|
|
(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))
|
|
|
|
|
|
(defwindow test
|
|
:monitor 0
|
|
:exclusive true
|
|
:geometry (geometry :x 0 :y 0 :width "100%" :height "20px" :anchor "top center")
|
|
(box
|
|
"${EWW_NET["enp34s0"]}"
|
|
(tooltip
|
|
"${time}"
|
|
(button "test"))))
|