This repository has been archived on 2019-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
2018-04-16 13:10:45 +02:00

15 lines
325 B
Bash
Executable File

#!/bin/bash
gawk '
/^MemFree:/ {
mfg=$2/1024^2
mfm=$2/1024
} END {
if (mfg > 2) { printf("%.1f GB", mfg) }
else { printf( "%.0f MB", mfm ) }
print("\n")
if (mfg > 4) { print("#04B431\n") }
else if (mfg > 2) { print("#FFA500\n") }
else { print("#FF0000\n") }
}' /proc/meminfo