From 2f024495b4ffb2d7cadac4675361fd482edf27b0 Mon Sep 17 00:00:00 2001 From: Ezri Date: Mon, 7 Apr 2025 12:12:15 -0600 Subject: [PATCH] Changed base font for eww --- .config/eww/eww.scss | 14 +++--- .config/eww/modules/clock.yuck | 18 +++++-- .config/eww/modules/network.yuck | 80 +++++++++++++++++++------------- .config/eww/modules/system.yuck | 14 +++--- .config/eww/modules/volume.yuck | 18 ++----- .config/eww/scripts/volume.py | 4 +- 6 files changed, 81 insertions(+), 67 deletions(-) diff --git a/.config/eww/eww.scss b/.config/eww/eww.scss index 5cdf934..879d5b6 100644 --- a/.config/eww/eww.scss +++ b/.config/eww/eww.scss @@ -10,7 +10,7 @@ .root { color: $foreground; - font-family: "Source Code Pro"; + font-family: "Armstrong"; font-size: 9pt; background-color: rgba(0, 0, 0, 0); // Probably needs to change @@ -23,24 +23,24 @@ margin: 10px; margin-top: 20px; margin-right: 0px; - padding-bottom: 26px; + padding-bottom: 26px; } &.right-side { margin: 10px; margin-top: 20px; margin-left: 0px; - padding-bottom: 26px; + padding-bottom: 26px; } &.bg { background-color: $bg0; padding: 10px; } +} - &.outline { - border: 1px solid $bg1; - } +.outline { + border: 1px solid $bg1; } .nebula { @@ -111,7 +111,7 @@ // sway module .sway--root.sway--vertical { - padding-top: 20px; + padding-top: 20px; } .sway--ws { diff --git a/.config/eww/modules/clock.yuck b/.config/eww/modules/clock.yuck index cb457cf..7662c82 100644 --- a/.config/eww/modules/clock.yuck +++ b/.config/eww/modules/clock.yuck @@ -8,11 +8,23 @@ (box :class "module text" :spacing 0 :orientation "v" - (label :class "special" - :text "${clock--data.hour}:${clock--data.minute}:${clock--data.second}") + (box :orientation "h" + :spacing -20 + :space-evenly true + :class "special" + "${clock--data.hour}" + ":" + "${clock--data.minute}" + ":" + "${clock--data.second}" + ;; (label :class "special" + ;; :text "${clock--data.hour}:${clock--data.minute}:${clock--data.second}") + ) (label :text "${clock--data.year}-${clock--data.month}-${clock--data.day}"))) + + (defwidget sideclock [] - (button :onclick "echo -n $(date +%Y-%d-%m) | wl-copy" + (button :onclick "echo -n $(date +%Y-%d-%m) | wl-copy && eww update clock--show=date && sleep 2 && eww update clock--show=clock" :onrightclick "echo -n $(date +%s) | wl-copy && eww update clock--show=unixtime && sleep 2 && eww update clock--show=clock" (overlay (box :class "module text nebula" diff --git a/.config/eww/modules/network.yuck b/.config/eww/modules/network.yuck index 72d959e..e11aea7 100644 --- a/.config/eww/modules/network.yuck +++ b/.config/eww/modules/network.yuck @@ -1,6 +1,8 @@ ;; -*-lisp-*- (deflisten network--data - `~/.config/eww/scripts/network.py`) + `~/.config/eww/scripts/network.py`) + +(defvar nebula-armstrong-alignment "-3px") (defvar network--show-details false) @@ -269,46 +271,56 @@ :spacing 10 :width 200 :space-evenly false - (box :halign "start" - :class "nebula" - "Route On:") - "" - (box :halign "end" - (label :text "No Route" - :class "highlight" - :visible {network--data.online && !network--data.have_default_route}) - (label :text "${network--data.default_route}" - :class "special" - :visible {network--data.online && network--data.have_default_route}))) - (centerbox :orientation "h" - :halign "start" - :spacing 10 - :width 200 - :space-evenly false + (transform :translate-y {network--data.have_default_route ? nebula-armstrong-alignment : "0px"} (box :halign "start" :valign "start" :class "nebula" - "Address:") + "Route On:")) "" (box :halign "end" - :orientation "v" - (label :text "${network--data.default_interface.addresses[0].address}" - :class "special") - (label :text "/${network--data.default_interface.addresses[0].prefixlen}" - :halign "end" - :class "special"))) + (label :text "No Route" + :class "nebula highlight" + :visible {!network--data.have_default_route}) + (label :text "${network--data.default_route}" + :class "special" + :visible {network--data.have_default_route}))) (centerbox :orientation "h" :halign "start" :spacing 10 :width 200 :space-evenly false + (transform :translate-y {network--data.online ? nebula-armstrong-alignment : "0px"} (box :halign "start" + :valign "start" :class "nebula" - "Public IP:") + "Address:")) + "" + (box :halign "end" + :valign "end" + :orientation "v" + (label :text "${network--data.default_interface.addresses[0].address}" + :class "special" + :visible {network--data.online}) + (label :text "offline" + :class "nebula highlight" + :visible {!network--data.online}) + (label :text "/${network--data.default_interface.addresses[0].prefixlen}" + :halign "end" + :class "special" + :visible {network--data.online}))) + (centerbox :orientation "h" + :halign "start" + :spacing 10 + :width 200 + :space-evenly false + (transform :translate-y {network--data.have_public_ip ? nebula-armstrong-alignment : "0px"} + (box :halign "start" + :class "nebula" + "Public IP:")) "" (box :halign "end" (label :text "Offline" - :class "highlight" + :class "nebula highlight" :visible {!network--data.have_public_ip}) (label :text {network--data.public_ip.ip} :class "special" @@ -318,9 +330,10 @@ :spacing 10 :width 200 :space-evenly false - (box :halign "start" - :class "nebula" - "Gateway:") + (transform :translate-y {network--data.have_gateway ? nebula-armstrong-alignment : "0px"} + (box :halign "start" + :class "nebula" + "Gateway:")) "" (box :halign "end" (label :text "Error" @@ -334,12 +347,13 @@ :spacing 10 :width 200 :space-evenly false - (box :halign "start" - :class "nebula" - "Wireless:") + (transform :translate-y {network--data.wifi.connected ? nebula-armstrong-alignment : "0px"} + (box :halign "start" + :class "nebula" + "Wireless:")) "" (box :halign "end" - (label :text "Offline" + (label :text "offline" :class "offline nebula" :visible {!network--data.wifi.connected}) (label :text {network--data.wifi.ssid} diff --git a/.config/eww/modules/system.yuck b/.config/eww/modules/system.yuck index a8ac11c..5ab5caa 100644 --- a/.config/eww/modules/system.yuck +++ b/.config/eww/modules/system.yuck @@ -18,7 +18,7 @@ :width 35 :space-evenly false :spacing 10 - :class "nebula" + :class "" (label :text "PWR" :class "special") (box :halign "center" @@ -92,7 +92,7 @@ :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" : "")}' + :class 'gauge ${(green ?: false) ? "green" : (((invert-threshold ?: false) ? (value < (threshold ?: 20)) : (value > (threshold ?: 80))) ? "highlight" : "")}' :start-at 37.5 :thickness 2))) @@ -157,7 +157,7 @@ :width 35 :space-evenly false :spacing 10 - :class "nebula" + :class "" (label :text "MEM" :class "special") (box :halign "center" @@ -200,7 +200,7 @@ :width 35 :space-evenly false :spacing 10 - :class "nebula" + :class "" (label :text "CPU" :class "special") (box :halign "center" @@ -241,7 +241,7 @@ :width 35 :space-evenly false :spacing 10 - :class "nebula" + :class "" (label :text "GPU" :class "special") (box :halign "center" @@ -281,8 +281,8 @@ :width 35 :space-evenly false :spacing 10 - :class "nebula" - (label :text "VRM" + :class "" + (label :text "VMEM" :class "special") (box :halign "center" (overlay diff --git a/.config/eww/modules/volume.yuck b/.config/eww/modules/volume.yuck index 4f47aa5..b0c25b7 100644 --- a/.config/eww/modules/volume.yuck +++ b/.config/eww/modules/volume.yuck @@ -34,8 +34,8 @@ :width 35 :space-evenly false :spacing 10 - :class "nebula" - (label :text "aud" + :class "" + (label :text "VOL" :class "special") (overlay :width 30 :height 30 @@ -79,7 +79,7 @@ :visible {!volume--data["${io}put"].mute} (label :text "%" :class "invisible") - (label :text {round(volume--data["${io}put"].volume, 0)} + (label :text {volume--data["${io}put"].volume} :class "special") (label :text "%" :class "offline")) @@ -92,18 +92,6 @@ :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" diff --git a/.config/eww/scripts/volume.py b/.config/eww/scripts/volume.py index 8bc8bd9..ae4d9b1 100755 --- a/.config/eww/scripts/volume.py +++ b/.config/eww/scripts/volume.py @@ -18,11 +18,11 @@ async def get_values(pulse): os.execv(sys.argv[0], sys.argv) sink_result = { "mute": sink.mute == 1, - "volume": f"{int(sink.volume.value_flat * 100):2}" + "volume": int(sink.volume.value_flat * 100 + 0.5) } source_result = { "mute": source.mute == 1, - "volume": f"{int(source.volume.value_flat * 100):2}" + "volume": int(source.volume.value_flat * 100 + 0.5) } result = { "output": sink_result,