1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-09-24 20:30:44 +00:00

Corrected calculation of used swap under linux.

This commit is contained in:
Dominik Ritter 2015-09-26 12:33:14 +02:00
parent 43a6079d83
commit f52a7f2570

View file

@ -709,7 +709,7 @@ prompt_ram() {
else else
swap_total=$(grep -o -E "SwapTotal:\s+[0-9]+" /proc/meminfo | grep -o "[0-9]*") swap_total=$(grep -o -E "SwapTotal:\s+[0-9]+" /proc/meminfo | grep -o "[0-9]*")
swap_free=$(grep -o -E "SwapFree:\s+[0-9]+" /proc/meminfo | grep -o "[0-9]*") swap_free=$(grep -o -E "SwapFree:\s+[0-9]+" /proc/meminfo | grep -o "[0-9]*")
swap_used=$(( swap_free - swap_total )) swap_used=$(( swap_total - swap_free ))
base=K base=K
fi fi