added used RAM indicator

This commit is contained in:
Enrico Fasoli 2015-08-28 13:55:07 +00:00
parent de469a185a
commit 8b88d97a7e

View File

@ -56,10 +56,20 @@ separator(){
echo -n "%{F$GREY}◆" echo -n "%{F$GREY}◆"
} }
getMEM(){
total=$(grep 'MemTotal' /proc/meminfo | egrep -o '[0-9]+')
not_apps=0
for mem in $(egrep '(MemFree|Buffers|Cached|Slab|PageTables|SwapCached)' /proc/meminfo | egrep -o '[0-9]+'); do
not_apps=$((not_apps+mem))
done
USEDMEM=$(echo "$((total-not_apps))/1000" | bc)
echo -n "%{F$BLUE}$USEDMEM MB"
}
buildBar () { buildBar () {
while true while true
do do
echo " $(getVolume) $(getMPD) %{c}$(buildClock) %{r} $(getDISK) $(separator) $(getNET) " echo " $(getVolume) $(getMPD) %{c}$(buildClock) %{r} $(getMEM) $(separator) $(getDISK) $(separator) $(getNET) "
sleep 1 sleep 1
done done
} }