added used RAM indicator
This commit is contained in:
parent
de469a185a
commit
8b88d97a7e
12
lemonbar.sh
12
lemonbar.sh
@ -56,10 +56,20 @@ separator(){
|
||||
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 () {
|
||||
while true
|
||||
do
|
||||
echo " $(getVolume) $(getMPD) %{c}$(buildClock) %{r} $(getDISK) $(separator) $(getNET) "
|
||||
echo " $(getVolume) $(getMPD) %{c}$(buildClock) %{r} $(getMEM) $(separator) $(getDISK) $(separator) $(getNET) "
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user