From 3042205f775a45533e97684aada395b23b9aefde Mon Sep 17 00:00:00 2001 From: GaspardCulis Date: Sat, 27 Jan 2024 18:58:40 +0100 Subject: [PATCH] eww: Fixed bar's connectivity widget SSID length --- bar/eww/bar.yuck | 3 ++- bar/eww/scripts/get-connectivity | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bar/eww/bar.yuck b/bar/eww/bar.yuck index 82e1e6d..fefb004 100644 --- a/bar/eww/bar.yuck +++ b/bar/eww/bar.yuck @@ -38,7 +38,8 @@ :onclick "bash -c 'iwgtk &> /dev/null &'" (label :class "connectivity" - :text " ${connectivity.status == "down" ? "down" : connectivity.ssid}") + :text " ${connectivity.status == "down" ? "down" : connectivity.ssid}" + :limit-width 14) ) ) diff --git a/bar/eww/scripts/get-connectivity b/bar/eww/scripts/get-connectivity index 23a7b01..28f3fc9 100755 --- a/bar/eww/scripts/get-connectivity +++ b/bar/eww/scripts/get-connectivity @@ -6,7 +6,7 @@ status (){ status=$(cat /sys/class/net/wlan0/operstate) if [ "$status" != "down" ]; then - ssid=$(iw dev wlan0 link | grep SSID | awk '{print $2}') + ssid="$(iw dev wlan0 link | grep SSID | cut -d':' -f2)" fi echo "{\"status\": \"$status\", \"ssid\": \"$ssid\"}"