2023-06-03 22:58:44 +00:00
|
|
|
(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)
|
|
|
|
)
|
|
|
|
|
2023-05-28 21:48:36 +00:00
|
|
|
(defwidget bar []
|
|
|
|
(centerbox
|
|
|
|
:orientation "h"
|
|
|
|
(workspaces)
|
|
|
|
(box)
|
|
|
|
(sidestuff)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defwidget sidestuff []
|
|
|
|
(box
|
|
|
|
:class "sidestuff"
|
|
|
|
:orientation "h"
|
|
|
|
:space-evenly false
|
|
|
|
:halign "end"
|
2023-10-18 16:57:36 +00:00
|
|
|
(checkbox
|
|
|
|
:onchecked "systemctl --user stop swayidle"
|
|
|
|
:onunchecked "systemctl --user restart swayidle"
|
|
|
|
)
|
2023-05-28 21:48:36 +00:00
|
|
|
(metric
|
|
|
|
:label ""
|
|
|
|
:value volume
|
|
|
|
)
|
|
|
|
(metric
|
|
|
|
:label ""
|
|
|
|
:value {EWW_BATTERY.total_avg}
|
|
|
|
)
|
|
|
|
(metric
|
|
|
|
:label ""
|
|
|
|
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
|
|
|
|
)
|
|
|
|
(metric
|
|
|
|
:label ""
|
|
|
|
:value {EWW_RAM.used_mem_perc}
|
|
|
|
)
|
|
|
|
(metric
|
|
|
|
:label ""
|
|
|
|
:value {EWW_CPU.avg}
|
|
|
|
)
|
|
|
|
time
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2023-06-08 19:08:25 +00:00
|
|
|
(deflisten workspaces
|
|
|
|
:initial "[]" "bash ~/.config/eww/scripts/get-workspaces"
|
|
|
|
)
|
|
|
|
(deflisten active_workspace
|
|
|
|
:initial "1" "bash ~/.config/eww/scripts/get-active-workspace"
|
|
|
|
)
|
2023-05-28 21:48:36 +00:00
|
|
|
(defwidget workspaces []
|
2023-06-08 19:08:25 +00:00
|
|
|
(eventbox
|
|
|
|
:class "workspaces-widget"
|
2023-05-28 21:48:36 +00:00
|
|
|
(box
|
|
|
|
:space-evenly false
|
|
|
|
(label
|
|
|
|
:text "${workspaces}${active_workspace}"
|
|
|
|
:visible false
|
|
|
|
)
|
|
|
|
(for workspace in workspaces
|
|
|
|
(eventbox
|
|
|
|
:onclick "hyprctl dispatch workspace ${workspace.id}"
|
|
|
|
(box
|
2023-06-03 22:58:44 +00:00
|
|
|
:class "workspace entry-${workspace.id}"
|
|
|
|
:space-evenly false
|
2023-05-28 21:48:36 +00:00
|
|
|
(label
|
2023-06-03 22:58:44 +00:00
|
|
|
:class "text ${workspace.id == active_workspace ? "active" : "unactive"} ${workspace.windows > 0 ? "occupied" : "empty"}"
|
2023-05-28 21:48:36 +00:00
|
|
|
:text "${workspace.id}"
|
|
|
|
)
|
2023-06-03 22:58:44 +00:00
|
|
|
(label
|
|
|
|
:class "seperator up ${workspace.id == active_workspace ? "active" : "unactive"}"
|
|
|
|
:text ""
|
|
|
|
)
|
|
|
|
(label
|
|
|
|
:class "seperator down ${workspace.id == active_workspace - 1 ? "active" : "unactive"}"
|
|
|
|
:text ""
|
|
|
|
)
|
2023-05-28 21:48:36 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2024-07-04 16:35:36 +00:00
|
|
|
(defwidget metric [label value]
|
2023-05-28 21:48:36 +00:00
|
|
|
(box
|
|
|
|
:orientation "h"
|
|
|
|
:class "metric"
|
|
|
|
:space-evenly false
|
|
|
|
(box
|
|
|
|
:class "label"
|
|
|
|
label
|
|
|
|
)
|
|
|
|
(scale
|
|
|
|
:min 0
|
|
|
|
:max 100
|
|
|
|
:value value
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defpoll volume
|
|
|
|
:interval "1s"
|
2024-07-06 13:37:06 +00:00
|
|
|
"wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/Volume: //' | tr -d '.'"
|
2023-05-28 21:48:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
(defpoll time
|
|
|
|
:interval "1s"
|
|
|
|
"date '+%Y-%m-%d %H:%M:%S'"
|
|
|
|
)
|