nix dotfiles
This commit is contained in:
commit
7b8005c867
27 changed files with 1728 additions and 0 deletions
14
navi/laniakea/eww/get_wifi.sh
Executable file
14
navi/laniakea/eww/get_wifi.sh
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
iface=$(ip link | awk '/state UP/ && !/lo/ {print $2}' | tr -d ':' | grep -v eth | head -1)
|
||||
ssid=$(iwgetid "$iface" -r 2>/dev/null)
|
||||
strength=$(awk "/$iface/ {print int(\$3 * 100 / 70)}" /proc/net/wireless 2>/dev/null)
|
||||
if [ -z "$ssid" ]; then
|
||||
echo " disconnected"
|
||||
else
|
||||
if [ "$strength" -ge 75 ]; then icon=""
|
||||
elif [ "$strength" -ge 50 ]; then icon=""
|
||||
elif [ "$strength" -ge 25 ]; then icon=""
|
||||
else icon=""
|
||||
fi
|
||||
echo "$icon $ssid $strength%"
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue