View Single Post
Posts: 73 | Thanked: 35 times | Joined on Jun 2013
#909
this is excellent, works great, but i dont want the colored bar, i just need it to color the actual credit amount, so {{dynamic color}}£4.99{{}}

have messed with it for HOURS in all variations, but cannot get it to behave just coloring the text



anyone?
Originally Posted by coderus View Post
script for USSD Balance, drawing your balance and colored percentage bar.
Code:
#!/bin/sh

max_balance=200
mid_balance=90
low_balance=30
echo -n "{{white}}"
balance=$(gconftool -g /apps/UssdBalance/currentStrBalance)
echo -n $balance
balance=${balance%.*}
if [ $balance -ge $mid_balance ]; then
    echo -n "{{green}}"
else 
    if [ $balance -ge $low_balance ]; then
	echo -n "{{yellow}}"
    else
	echo -n "{{red}}"
    fi
fi
echo -n " {{="
if [ $balance -ge $max_balance ]; then
    echo -n "1.0"
else
    echo -n "0."$((balance/2))
fi
echo -n "}}"