From f6a80afbd806f7c53db97a947c119ce942930acc Mon Sep 17 00:00:00 2001 From: soraefir Date: Sun, 18 Feb 2024 10:13:33 +0100 Subject: [PATCH] [m] Fixing Eww Scripts --- modules/home/wayland/apps/eww/bar/modules/sys.yuck | 1 + modules/home/wayland/apps/eww/bar/scripts/net/net | 3 ++- modules/home/wayland/apps/eww/bar/scripts/sys/battery | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/home/wayland/apps/eww/bar/modules/sys.yuck b/modules/home/wayland/apps/eww/bar/modules/sys.yuck index 1f2e389..2f55dcc 100644 --- a/modules/home/wayland/apps/eww/bar/modules/sys.yuck +++ b/modules/home/wayland/apps/eww/bar/modules/sys.yuck @@ -36,6 +36,7 @@ :visible {battery.visible} :style "color: ${battery.color};" :thickness 6 + :tooltip "${battery.status}" (label :class "icon-text" :text "B")) ) ) diff --git a/modules/home/wayland/apps/eww/bar/scripts/net/net b/modules/home/wayland/apps/eww/bar/scripts/net/net index 699f987..7efbfb1 100755 --- a/modules/home/wayland/apps/eww/bar/scripts/net/net +++ b/modules/home/wayland/apps/eww/bar/scripts/net/net @@ -26,7 +26,8 @@ function gen_wifi() { icon=${icons[$level]} ip="-" class="net-connected" - name=printf wpa_cli status | grep \^ssid= | sed 's/ssid=//g' + name_raw=$(wpa_cli status | grep \^ssid= | sed 's/ssid=//g') + name=$(printf "%s" $name_raw) } function gen_ethernet() { diff --git a/modules/home/wayland/apps/eww/bar/scripts/sys/battery b/modules/home/wayland/apps/eww/bar/scripts/sys/battery index 09249a0..070cbc6 100755 --- a/modules/home/wayland/apps/eww/bar/scripts/sys/battery +++ b/modules/home/wayland/apps/eww/bar/scripts/sys/battery @@ -39,9 +39,9 @@ gettime() { if [ "$RATE" -gt 0 ]; then if [ "$STATE" = "Discharging" ]; then - EX="$NOW / $RATE" + EX=$(($NOW / $RATE)) else - EX="($FULL - $NOW) / $RATE" + EX=$(( ($FULL - $NOW) / $RATE)) fi date -u -d@"$(awk -v ex="$EX" 'BEGIN{print ex * 3600}')" +%H:%M fi