infrastructure/home/wayland/eww/config/eww.yuck
Laureηt bd71229ba9
🚚 (home/wayland) move eww's config in its own folder
(this way `default.nix` won't be copied inside the configDir)
2023-12-30 18:41:19 +01:00

134 lines
2.6 KiB
Plaintext

(defwindow bar
:monitor 0
:windowtype "dock"
:exclusive true
:geometry (geometry
:x "0%"
:y "0%"
:width "100%"
:anchor "top center"
)
:reserve (struts
:side "top"
:distance "4%"
)
(bar)
)
(defwidget bar []
(centerbox
:orientation "h"
(workspaces)
(box)
(sidestuff)
)
)
(defwidget sidestuff []
(box
:class "sidestuff"
:orientation "h"
:space-evenly false
:halign "end"
(checkbox
:onchecked "systemctl --user stop swayidle"
:onunchecked "systemctl --user restart swayidle"
)
(metric
:label "󰕾"
:value volume
:onchange "pamixer --set-volume {}"
)
(metric
:label "󱐋"
:value {EWW_BATTERY.total_avg}
:onchange ""
)
(metric
:label "󰋊"
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
:onchange ""
)
(metric
:label ""
:value {EWW_RAM.used_mem_perc}
:onchange ""
)
(metric
:label "󰍛"
:value {EWW_CPU.avg}
:onchange ""
)
time
)
)
(deflisten workspaces
:initial "[]" "bash ~/.config/eww/scripts/get-workspaces"
)
(deflisten active_workspace
:initial "1" "bash ~/.config/eww/scripts/get-active-workspace"
)
(defwidget workspaces []
(eventbox
:class "workspaces-widget"
(box
:space-evenly false
(label
:text "${workspaces}${active_workspace}"
:visible false
)
(for workspace in workspaces
(eventbox
:onclick "hyprctl dispatch workspace ${workspace.id}"
(box
:class "workspace entry-${workspace.id}"
:space-evenly false
(label
:class "text ${workspace.id == active_workspace ? "active" : "unactive"} ${workspace.windows > 0 ? "occupied" : "empty"}"
:text "${workspace.id}"
)
(label
:class "seperator up ${workspace.id == active_workspace ? "active" : "unactive"}"
:text ""
)
(label
:class "seperator down ${workspace.id == active_workspace - 1 ? "active" : "unactive"}"
:text ""
)
)
)
)
)
)
)
(defwidget metric [label value onchange]
(box
:orientation "h"
:class "metric"
:space-evenly false
(box
:class "label"
label
)
(scale
:min 0
:max 100
:active {onchange != ""}
:value value
:onchange onchange
)
)
)
(defpoll volume
:interval "1s"
"pamixer --get-volume"
)
(defpoll time
:interval "1s"
"date '+%Y-%m-%d %H:%M:%S'"
)