mirror of
https://github.com/tiyn/dotfiles.git
synced 2025-03-28 05:57:45 +01:00
statusbar: added special case for inet
This commit is contained in:
parent
c9eda035e8
commit
4e277ed808
@ -1,9 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
wifipercent=" "
|
||||
|
||||
|
||||
if ! ls /sys/class/net/*/operstate > /dev/null 2>&1; then
|
||||
if ! [[ -f /sys/class/net/w* ]]; then
|
||||
wifiicon="^c#ff0000^ ^d^" && wifipercent=0
|
||||
else
|
||||
[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="^c#ff0000^ ^d^" && wifipercent=0
|
||||
|
@ -2,4 +2,6 @@
|
||||
|
||||
icon="^b#282828^^c#dfdfdf^ ^d^ "
|
||||
total=$(free -h | awk '/^Mem:/ {print $3/$2}')
|
||||
echo "$icon$(printf %3s $(echo ${total##*0.} | cut -c1-2) | tr ' ' ' ')%"
|
||||
percent=${total##*0\.}
|
||||
percent=$(printf %3s $(echo ${percent##*0} | cut -c1-2) | tr ' ' ' ')%
|
||||
echo "$icon $percent"
|
||||
|
Loading…
x
Reference in New Issue
Block a user