View Single Post
dr_frost_dk's Avatar
Posts: 1,503 | Thanked: 2,688 times | Joined on Oct 2010 @ Denmark
#625
I must assume at this point that you have no programming skills, even at this "baby" level.

Here's the code from the 1.6

Code:
charge=$(hal-device | grep is.charging | awk '{printf $3}')
x=$(hal-device | grep voltage.current | awk '{printf "%4.0f",$3}')
if [ $x -ge 4050 ];then
echo $x | awk '{printf "%3.1f", 85 + ($1 - 4050) / 12}{print "%"}'
level=0;fi\nif [ $x -ge 3900 -a $x -lt 4050 ];then
echo $x | awk '{printf "%3.1f", 70 + ($1 - 3900) / 10}{print "%"}'
level=0;fi\nif [ $x -ge 3800 -a $x -lt 3900 ];then
echo $x | awk '{printf "%3.1f", 50 + ($1 - 3800) / 5}{print "%"}'
level=0;fi\nif [ $x -ge 3660 -a $x -lt 3800 ];then
echo $x | awk '{printf "%3.1f", 15 + ($1 - 3660) / 4}{print "%"}'
level=1;fi\nif [ $x -ge 3600 -a $x -lt 3660 ];then
echo $x | awk '{printf "%3.1f", 5 + ($1 - 3600) / 6}{print "%"}'
level=2;fi\nif [ $x -lt 3600 ];then
echo $x | awk '{printf "%3.1f", ($1 - 3300) / 60}{print "%"}'
level=3;fi
if [ $level -gt 1 ]; then
dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_activate string:"PatternError"
fi
if [ $level -le 1 ]; then
dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_deactivate string:"PatternError"
fi
if [ $charge == "true" ];then 
echo "Charging"
else 
echo $x | awk '{printf "%1.3fV", $x / 1000}'
fi
exit $level
To disable led notification the simple way is to change "if [ $level -le 1] to 5 instead of 1, this also applies to the "-gt 1", change both to 5. Do this in the bottom with the dbus-send lines