1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-03-19 02:17:44 +01:00

11 lines
466 B
Plaintext
Raw Normal View History

2019-09-13 21:03:54 +02:00
#!/usr/bin/env sh
2019-09-07 17:42:18 +02:00
2023-10-17 05:18:46 +02:00
wifipercent=" ___"
2019-09-07 17:42:18 +02:00
2023-10-17 05:18:46 +02:00
[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="^c#ff0000^ ^d^"
2019-09-07 17:42:18 +02:00
2023-10-17 05:18:46 +02:00
[ ! -n "${wifiicon+var}" ] && wifiicon="^c#dfdfdf^ ^d^" && wifipercent=$(grep "^\s*w" /proc/net/wireless | awk '{ print int($3 * 100 / 70) }')
wifipercent=$(printf %3s $wifipercent | tr ' ' ' ')
echo "$(cat /sys/class/net/e*/operstate | sed "s/down/^b#282828^^c#ff0000^  /;s/up/^b#282828^^c#dfdfdf^ 󰈀 /")" "$wifiicon" "$wifipercent%"