From b31f48d09f786af5c1a3eb8bfb52cfb0490bda28 Mon Sep 17 00:00:00 2001 From: Piotr Russ Date: Thu, 3 Dec 2020 01:02:31 +0100 Subject: init comit --- wifi | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 wifi (limited to 'wifi') diff --git a/wifi b/wifi new file mode 100755 index 0000000..aacc3b8 --- /dev/null +++ b/wifi @@ -0,0 +1,15 @@ +#!/bin/sh +case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in + down) + echo "\004 \001" + ;; + up) + ssid="$(iw dev | grep ssid | awk '{print $2}')" + percent="$(awk '/^\s*w/ { print int($3 * 100 / 70) }' /proc/net/wireless)" + wifiicon=" " + [ $percent -le 50 ] && [ $percent -gt 25 ] && color=$(echo '\003') || color='' + [ $percent -le 25 ] && color=$(echo '\004') + printf "%s%s%s%s\001" "$wifiicon" "$ssid " $color "($percent%)" + ;; +esac + -- cgit v1.2.3