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.

19 lines
472 B

10 years ago
#!/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 5 -w 50`
else
PERCBAR=`echo -e "$PERC"\
| gdbar -bg $bar_bg -fg $bar_fg -h 5 -w 50`
fi
ICON='^i(/home/zubin/.xmonad/dzen2/'"$ICON)"
echo "$ICON $PERCBAR"