diff --git a/.config/eww/eww.scss b/.config/eww/eww.scss index 1b20997..5cdf934 100644 --- a/.config/eww/eww.scss +++ b/.config/eww/eww.scss @@ -23,12 +23,14 @@ margin: 10px; margin-top: 20px; margin-right: 0px; + padding-bottom: 26px; } &.right-side { margin: 10px; margin-top: 20px; margin-left: 0px; + padding-bottom: 26px; } &.bg { @@ -108,6 +110,10 @@ // sway module +.sway--root.sway--vertical { + padding-top: 20px; +} + .sway--ws { color: $bg1; diff --git a/.config/eww/eww.yuck b/.config/eww/eww.yuck index 6d5fdd6..2d42202 100644 --- a/.config/eww/eww.yuck +++ b/.config/eww/eww.yuck @@ -60,23 +60,6 @@ :stacking "fg" (sidebar :orientation {side})) - - -;; (defwindow network-status -;; :monitor 0 -;; :geometry (geometry :width "200px" -;; :height "0px" -;; :x "300px" -;; :y "0px" -;; :anchor "top right") -;; :exclusive false -;; :focusable false -;; :stacking "overlay" -;; (box :orientation "v" -;; :class "bar root bg outline" -;; :visible {network--show-details} -;; (network-detail))) - (defwindow laptopbar [group battery] :geometry (geometry :width "100%" @@ -87,7 +70,21 @@ :stacking "fg" (centerbox :orientation "h" :class "bar root" - (ws-group-leftalign :workspace-group {group}) + (box :orientation "h" + :halign "start" + + (sway-workspace :group {group})) (hostname-centeralign) (laptop-details-rightalign :battery {battery} ))) +(defwindow laptopsidebar [group battery side] + :geometry (geometry :width "35px" + :height "100%" + :anchor "${side} center") + :exclusive true + :focusable false + :stacking "fg" + (small-sidebar :orientation {side} + :battery {battery} + :workspace-group {group})) + diff --git a/.config/eww/modules/system.yuck b/.config/eww/modules/system.yuck index 151d2a5..a8ac11c 100644 --- a/.config/eww/modules/system.yuck +++ b/.config/eww/modules/system.yuck @@ -12,6 +12,22 @@ :text "${EWW_BATTERY[battery].capacity}%") (label :text "${EWW_BATTERY[battery].status == 'Charging' || EWW_BATTERY[battery].status == 'Full' ? 'external' : 'internal'} power"))) +(defwidget system-battery-gauge-small [battery] + (box :orientation "v" + :halign "center" + :width 35 + :space-evenly false + :spacing 10 + :class "nebula" + (label :text "PWR" + :class "special") + (box :halign "center" + (overlay + (system--small-gauge :value {EWW_BATTERY[battery].capacity} + :threshold 25 + :invert-threshold true + :green {EWW_BATTERY[battery].status == "Charging" || EWW_BATTERY[battery].capacity == 100}))))) + (defwidget system-name [] (label :halign "center" :valign "center" @@ -56,7 +72,7 @@ :text "${round(system--data.memory.used / 1024 / 1024 / 1024, 2)} / ${round(system--data.memory.total / 1024 / 1024 / 1024, 2)} GiB") (label :text "system memory"))) -(defwidget system--gauge [value ?threshold] +(defwidget system--gauge [value ?threshold ?green] (overlay :width 80 :height 80 (circular-progress :value 75 @@ -68,6 +84,18 @@ :start-at 37.5 :thickness 2))) +(defwidget system--small-gauge [value ?threshold ?green ?invert-threshold] + (overlay :width 30 + :height 30 + (circular-progress :value 75 + :class "gauge-gutter" + :start-at 37.5 + :thickness 2) + (circular-progress :value {value * 0.75} + :class 'gauge ${((invert-threshold ?: false) ? (value < (threshold ?: 20)) : (value > (threshold ?: 80))) ? "highlight" : ((green ?: false) ? "green" : "")}' + :start-at 37.5 + :thickness 2))) + (defwidget cpu-mem-gauges [] (box :orientation "v" :space-evenly false @@ -121,7 +149,22 @@ (transform :translate-y "3px" (label :text "%" - :class "offline")))))))) + :class "offline")))))))) + +(defwidget system--memory-gauge-small [] + (box :orientation "v" + :halign "center" + :width 35 + :space-evenly false + :spacing 10 + :class "nebula" + (label :text "MEM" + :class "special") + (box :halign "center" + (overlay + (system--small-gauge :value {system--data.memory.percent}))))) + + (defwidget system--cpu-gauge [] (box :orientation "v" @@ -151,6 +194,20 @@ :class "offline")))))) )) +(defwidget system--cpu-gauge-small [] + (box :orientation "v" + :halign "center" + :width 35 + :space-evenly false + :spacing 10 + :class "nebula" + (label :text "CPU" + :class "special") + (box :halign "center" + (overlay + (system--small-gauge :value {system--data.cpu.avg} + :threshold 80))))) + (defwidget system--gpu-gauge [] (box :orientation "v" :halign "start" @@ -176,7 +233,20 @@ (transform :translate-y "3px" (label :text "%" - :class "offline")))))))) + :class "offline")))))))) + +(defwidget system--gpu-gauge-small [] + (box :orientation "v" + :halign "center" + :width 35 + :space-evenly false + :spacing 10 + :class "nebula" + (label :text "GPU" + :class "special") + (box :halign "center" + (overlay + (system--small-gauge :value {system--data.gpu.load * 100}))))) (defwidget system--vram-gauge [] (box :orientation "v" @@ -203,7 +273,20 @@ (transform :translate-y "3px" (label :text "%" - :class "offline")))))))) + :class "offline")))))))) + +(defwidget system--vram-gauge-small [] + (box :orientation "v" + :halign "center" + :width 35 + :space-evenly false + :spacing 10 + :class "nebula" + (label :text "VRM" + :class "special") + (box :halign "center" + (overlay + (system--small-gauge :value {system--data.gpu.memory * 100}))))) (defwidget system--gauge-generic [value value-fmt big-text little-text ?subscript ?threshold] @@ -247,4 +330,5 @@ (label :text {big-text} :class "big nebula") (label :text {little-text} - :class "nebula special"))))) + :class "nebula special"))))) + diff --git a/.config/eww/modules/volume.yuck b/.config/eww/modules/volume.yuck index a4c8342..4f47aa5 100644 --- a/.config/eww/modules/volume.yuck +++ b/.config/eww/modules/volume.yuck @@ -28,6 +28,36 @@ :text "${volume--data.input.volume}%")) "audio system")) +(defwidget volume-small-gauge [] + (box :orientation "v" + :halign "center" + :width 35 + :space-evenly false + :spacing 10 + :class "nebula" + (label :text "aud" + :class "special") + (overlay :width 30 + :height 30 + (circular-progress :value {75 / 2.05} + :class "gauge-gutter" + :start-at 37.5 + :thickness 2) + (circular-progress :value {75 / 2.05} + :class "gauge-gutter" + :start-at 12.5 + :clockwise false + :thickness 2) + (circular-progress :value {volume--data.output.mute ? 0 : min(volume--data.output.volume * 0.75 / 2.05, 75 / 2.05)} + :class 'gauge ${volume--data.output.mute ? "green" : volume--data.output.volume > 100 ? "highlight" : ""}' + :start-at 37.5 + :thickness 2) + (circular-progress :value {volume--data.input.mute ? 0 : min(volume--data.input.volume * 0.75 / 2.05, 75 / 2.05)} + :class 'gauge ${volume--data.input.mute ? "green" : volume--data.input.volume > 100 ? "highlight" : ""}' + :start-at 12.5 + :clockwise false + :thickness 2)))) + (defwidget volume--gauge [io] (box :orientation "v" :halign {io == "in" ? "start" : "end"} @@ -62,6 +92,19 @@ :class "offline")) )))))) +(defwidget volume--gauge-small [io] + (box :orientation "v" + :halign "center" + :width 35 + :space-evenly false + :spacing 10 + :class "nebula" + (label :text "CPU" + :class "special") + (box :halign "center" + (overlay + (system--small-gauge :value {system--data.gpu.load * 100}))))) + (defwidget volume-gauges [] (box :orientation "v" :space-evenly false diff --git a/.config/eww/modules/workspaces.yuck b/.config/eww/modules/workspaces.yuck index 7828d0e..608ebdb 100644 --- a/.config/eww/modules/workspaces.yuck +++ b/.config/eww/modules/workspaces.yuck @@ -12,6 +12,7 @@ :start-at 0 :clockwise true :width 16 + :height 16 :thickness 1 (box :class 'fill' )))) @@ -68,6 +69,17 @@ (for workspace in {sway--data.ws[sway--data.context ?: "personal"][group]} (sway--workspace :ws workspace)))) +(defwidget sway-workspaces-vertical [group] + (box :orientation "v" + :valign "start" + :halign "center" + :visible {sway--data != ''} + :space-evenly false + :spacing 5 + :class "sway--root sway--vertical" + (for workspace in {sway--data.ws[sway--data.context ?: "personal"][group]} + (sway--workspace :ws workspace)))) + (defwidget hypr-workspaces [group] (box :orientation "h" :halign "start" diff --git a/.config/eww/windows.yuck b/.config/eww/windows.yuck index 940d841..13a27bc 100644 --- a/.config/eww/windows.yuck +++ b/.config/eww/windows.yuck @@ -17,6 +17,23 @@ (system-gauges) (volume-gauges))) +(defwidget small-sidebar [orientation battery workspace-group] + (centerbox :orientation "v" + :class "root ${orientation}-side" + (sway-workspaces-vertical :group {workspace-group}) + "" + (box :orientation "v" + :valign "end" + :space-evenly false + :spacing 10 + + (system--cpu-gauge-small) + (system--memory-gauge-small) + (system--gpu-gauge-small) + (system--vram-gauge-small) + (volume-small-gauge) + (system-battery-gauge-small :battery {battery})))) + (defwidget ws-group-rightalign [workspace-group] (box :orientation "h" :halign "end"