You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

18 lines
518 B

#!/bin/bash
source $(dirname $0)/config.sh
FREE=`free -m | awk 'NR == 3 {gsub(/%/,""); print $3}'`
MAX=`free -m | awk 'NR == 2 {gsub(/%/,""); print $2}'`
PERC=`echo $FREE*100/$MAX | bc`
ICON="mem.xbm"
if [[ $PERC -gt 75 ]]; then
PERCBAR=`echo -e "$PERC"\
| gdbar -bg $bar_bg -fg $warning -h 1 -w 180`
else
PERCBAR=`echo -e "$PERC"\
| gdbar -bg $bar_bg -fg $bar_fg -h 1 -w 180`
fi
ICON='^i(/home/zubin/.xmonad/dzen2/'"$ICON)"
echo "^fg($white0)$ICON^fg() FREE $PERCBAR ^fg($highlight)$PERC%"