statusbar: added special case for inet

master
tiyn 1 year ago
parent c9eda035e8
commit 4e277ed808

@ -1,9 +1,6 @@
#!/bin/sh #!/bin/sh
wifipercent=" " if ! [[ -f /sys/class/net/w* ]]; then
if ! ls /sys/class/net/*/operstate > /dev/null 2>&1; then
wifiicon="^c#ff0000^ ^d^" && wifipercent=0 wifiicon="^c#ff0000^ ^d^" && wifipercent=0
else else
[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="^c#ff0000^ ^d^" && wifipercent=0 [ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="^c#ff0000^ ^d^" && wifipercent=0

@ -2,4 +2,6 @@
icon="^b#282828^^c#dfdfdf^  ^d^ " icon="^b#282828^^c#dfdfdf^  ^d^ "
total=$(free -h | awk '/^Mem:/ {print $3/$2}') 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…
Cancel
Save