diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2020-03-22 09:08:05 -0400 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2020-03-22 09:08:05 -0400 |
| commit | 1f248379524fcb53da8a57480909850bc34e5588 (patch) | |
| tree | 27be08ae911c82f16e41fd6de9708284dc2d274f /.local/bin | |
| parent | 54f22aab7bda7674340683d294dd50d0dc27761b (diff) | |
| download | eibhear-1f248379524fcb53da8a57480909850bc34e5588.tar.gz eibhear-1f248379524fcb53da8a57480909850bc34e5588.tar.zst eibhear-1f248379524fcb53da8a57480909850bc34e5588.zip | |
internet script more efficient
Diffstat (limited to '.local/bin')
| -rwxr-xr-x | .local/bin/statusbar/internet | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/.local/bin/statusbar/internet b/.local/bin/statusbar/internet index 4935294..8063e19 100755 --- a/.local/bin/statusbar/internet +++ b/.local/bin/statusbar/internet @@ -10,8 +10,7 @@ case $BLOCK_BUTTON in " ;; esac -[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="📡" +[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="📡" || + wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }') -[ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }') - -printf "%s %s\n" "$wifiicon" "$(cat /sys/class/net/e*/operstate | sed "s/down/❎/;s/up/🌐/")" +printf "%s %s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate)" |
