1
0
mirror of https://github.com/eoli3n/dotfiles synced 2024-11-22 23:12:32 +01:00
eoli3n-dotfiles/roles/eww/templates/eww.yuck.j2

77 lines
2.0 KiB
Plaintext
Raw Normal View History

2023-11-06 13:39:40 +01:00
(defwidget bar []
(centerbox :orientation "h"
(workspaces)
(music)
(sidestuff)))
(defwidget sidestuff []
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
(metric :label "🔊"
:value volume
:onchange "amixer -D pulse sset Master {}%")
(metric :label "ï¡š"
:value {EWW_RAM.used_mem_perc}
:onchange "")
(metric :label "💾"
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
:onchange "")
time))
2023-11-08 15:01:15 +01:00
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
(deflisten current_workspace :initial "none" "bash ~/.config/eww/scripts/get-active-workspace")
2023-11-06 13:39:40 +01:00
(defwidget workspaces []
(box :class "workspaces"
:space-evenly true
:halign "start"
2023-11-08 15:01:15 +01:00
(label :text "${current_workspace}" :visible false)
(for workspace in workspaces
(eventbox :onclick "swaymsg workspace ${workspace.name}"
(box :class "workspace-entry ${workspace.focused ? "current" : ""}"
2023-11-08 15:01:15 +01:00
(label :text "${workspace.icon}")
)
)
)
)
)
2023-11-06 13:39:40 +01:00
(defwidget music []
(box :class "music"
:orientation "h"
:space-evenly false
:halign "center"
{music != "" ? " ${music}" : ""}))
(defwidget metric [label value onchange]
(box :orientation "h"
:class "metric"
:space-evenly false
(box :class "label" label)
(scale :min 0
:max 101
:active {onchange != ""}
:value value
:onchange onchange)))
(deflisten music :initial ""
2023-11-08 16:36:54 +01:00
"playerctl --follow metadata --format '{% raw %}{{ artist }} - {{ title }}{% endraw %}' || true")
2023-11-06 13:39:40 +01:00
(defpoll volume :interval "1s"
"scripts/getvol")
(defpoll time :interval "1s"
"date '+%d%m%y %H%M%S'")
(defwindow bartop
:monitor 0
:windowtype "dock"
:geometry (geometry :x "0%"
:y "0%"
:width "100%"
:height "10px"
:anchor "top center")
:reserve (struts :side "top" :distance "4%")
(bar))