Fix ram and show only ram by default.

This commit is contained in:
koksnuss 2018-05-31 23:14:17 +02:00
parent 4ffb6fc5d3
commit 3c38c7d32d
2 changed files with 3 additions and 3 deletions

2
config
View File

@ -25,7 +25,7 @@ interval=60
[ram] [ram]
label=⚟ label=⚟
# instance=long # instance=long
# instance=ram instance=ram
# [ram] # [ram]
# instance=swap # instance=swap

View File

@ -5,7 +5,7 @@
[[ "$BLOCK_INSTANCE" =~ "long" || "$BLOCK_BUTTON" == 1 ]] && LONG=true [[ "$BLOCK_INSTANCE" =~ "long" || "$BLOCK_BUTTON" == 1 ]] && LONG=true
if [[ "$BLOCK_INSTANCE" =~ "ram" ]]; then if [[ "$BLOCK_INSTANCE" =~ "ram" ]]; then
TYPE='swap' TYPE='ram'
elif [[ "$BLOCK_INSTANCE" =~ "swap" ]]; then elif [[ "$BLOCK_INSTANCE" =~ "swap" ]]; then
TYPE='swap' TYPE='swap'
fi fi
@ -59,7 +59,7 @@ gawk -v TYPE="$TYPE" -v LONG="$LONG" '
} }
} }
} else { } else {
load = mfg / mtg load = 100 - mfg / mtg * 100
if (load < 100 / 9) { if (load < 100 / 9) {
printf("▁\n▁\n") printf("▁\n▁\n")
} else if (load < 100 / 9 * 2 ) { } else if (load < 100 / 9 * 2 ) {