well there are a few ways to get free memory. the most useful for this widget would be head -n 2 /proc/meminfo | tail -n 1 this will give you free mem in one line.