summaryrefslogtreecommitdiff
path: root/.local/bin/memu
blob: 900486693284d9e2c0ca5ca0991560cf2732f610 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/awk -f
# memu - print memory usage 

BEGIN {
    while (getline < "/proc/meminfo") {
        if ($1 == "MemTotal:")  t=$2;
        if ($1 == "MemAvailable:") {
            printf "%.1fG/%.1fG\n", (t-$2)/1000000, t/1000000;
            exit;
        }
    }
}