From 20faaeea247f67ef4ebadc94fab8653eb75c596d Mon Sep 17 00:00:00 2001 From: Candifloss Date: Thu, 1 Aug 2024 17:22:49 +0000 Subject: [PATCH] Add eww/sh/values/wifi.sh --- eww/sh/values/wifi.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 eww/sh/values/wifi.sh diff --git a/eww/sh/values/wifi.sh b/eww/sh/values/wifi.sh new file mode 100644 index 0000000..121ebfd --- /dev/null +++ b/eww/sh/values/wifi.sh @@ -0,0 +1,9 @@ +res=$(nmcli device wifi list | sed 's/\ \ \ */|/g' | grep "*" | cut -d"|" -f 3,6,8) + +name=${res%%|*} +bars=${res##*|} +bars=$(( 4 - $(echo $bars | tr -dc "_" |wc -c) )) +speed=${res#*|} +speed=${speed%|*} + +echo "{\"name\":\"$name\",\"speed\":\"$speed\",\"bars\":\"$bars\",\"icon\":\"\"}" \ No newline at end of file