eww: Fixed bar's connectivity widget SSID length

This commit is contained in:
GaspardCulis 2024-01-27 18:58:40 +01:00
parent 66cda354ba
commit 3042205f77
2 changed files with 3 additions and 2 deletions

View file

@ -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)
)
)

View file

@ -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\"}"