Redesign Eww bars

This commit is contained in:
soraefir
2023-11-21 16:52:35 +01:00
parent 285d5caa8e
commit 8a833d1eb6
47 changed files with 785 additions and 37 deletions

View File

@@ -0,0 +1,31 @@
(defvar date_rev false)
(defwidget clock []
(box
:class "module datetime"
(eventbox
:onhover "${EWW_CMD} update date_rev=true"
:onhoverlost "${EWW_CMD} update date_rev=false"
(overlay
(box
:orientation "v"
(button
:class "hour" hour)
(button
:class "minute" minute))
(revealer
:reveal date_rev
(box
:class "date"
:orientation "v"
(button
:onclick "${EWW_CMD} open --toggle calendar"
:class "day" day)
(button
:onclick "${EWW_CMD} open --toggle calendar"
:class "month" month)))))))
(defpoll hour :interval "15s" "date '+%H'")
(defpoll minute :interval "15s" "date '+%M'")
(defpoll day :interval "15s" "date '+%d'")
(defpoll month :interval "15s" "date '+%m'")

View File

@@ -0,0 +1,16 @@
(deflisten net "scripts/net/net")
(defwidget net []
(box
:class "module"
:orientation "v"
(button
:class "net"
:tooltip {net.name}
{net.icon})
(button
:class "blt"
(label :class "icon-text" :text "B"))
)
)

View File

@@ -0,0 +1,38 @@
(deflisten cpu "scripts/sys/cpu")
(deflisten gpu "scripts/sys/gpu")
(deflisten memory "scripts/sys/memory")
(deflisten battery "scripts/sys/battery")
(defwidget sys []
(box
:class "module"
:orientation "v"
(circular-progress
:value {EWW_CPU.avg}
:class "cpubar"
:thickness 6
(label :class "icon-text" :text "C"))
(circular-progress
:value {gpu.devices[0].GRBM2.CommandProcessor-Graphics.value}
:class "gpubar"
:thickness 6
(label :class "icon-text" :text "G"))
(circular-progress
:value {memory.percent}
:class "membar"
:thickness 6
(label :class "icon-text" :text "M"))
(circular-progress
:value {battery.percentage}
:class "batbar"
:visible {battery.visible}
:style "color: ${battery.color};"
:thickness 6
(label :class "icon-text" :text "B"))
)
)

View File

@@ -0,0 +1,16 @@
(deflisten workspace "scripts/workspaces")
(defwidget workspaces []
(eventbox
:onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace"
(box
:class "module workspaces"
:orientation "v"
(for ws in workspace
(button
:onclick "hyprctl dispatch workspace ${ws.number}"
:class "ws icon ${ws.color}"
; :tooltip {ws.tooltip}
(box
:class `${ws.focused ? "focused" : ""}`
:height 3))))))