Notices


Reply
Thread Tools
Posts: 306 | Thanked: 566 times | Joined on Jan 2010 @ Romania
#21
i wrote a plain script * who drive the led ALL colors with color of the pulse function of time digits when charger is plugged
the idea is to keep led white and modify leds currents

* the script ( Pulsar ) is unfinished and work well until battery is fully charged when full white pattern is changed to full green.
an early variant of the script you can find here :
http://talk.maemo.org/showpost.php?p...4&postcount=33
actual script is more finished and obfuscated and i thought also at battery status indicator.
if i find time i will finish this script with an option of time , battery status or both.
Attached Images
 

Last edited by blue_led; 2010-10-07 at 21:27.
 
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#22
I added a method for preventing MCE from interfering with the leds, and it is available in power-kernel. This adds a dominant attribute called dbrightness to the leds such that if this attribute is set to non-negative, writes to regular brightness attributes are ignored, so MCE works as usual, it just has no affect.

Someone could implement the same for the engines, thus allowing for temporarily preventing MCE from controlling the leds.
__________________
My repository

"N900 community support for the MeeGo-Harmattan" Is the new "Mer is Fremantle for N810".

No more Nokia devices for me.
 

The Following User Says Thank You to Matan For This Useful Post:
Posts: 968 | Thanked: 974 times | Joined on Nov 2008 @ Ohio
#23
Since it was requested, I'll post the script I used.
If you are unsure what it is doing or how to use it, please don't, it can screw up your mce.ini file which will definitely screw up your system, causing you to have to flash it, or possibly bricking your N900. It takes more than just copying the script and running it, additional steps are needed. If you can't figure them out, don't use it. Not responsible for any harm to your phone.

This is just a brute force method, very likely the worst way to do it. As noted earlier in the thread, it resets mce occasionally, which will clear any other notifications (missed call, im, email, sms, etc). Unless you are more concerned about the battery level than other notifications, I wouldn't use it.

I tested it for about 12 hours (1-2 bars, charging overnight, 8-7 bars in morning). It seems to work.

Again, probably the worst way to do this and it will cause you to miss other notifications.


Code:
#! /bin/bash

sudo gainroot
#set variables for current bar level and previous bar level
curbar=`lshal | grep battery.charge_level.current | awk '{print $3}'`
prevbar=`cat /home/user/.ledcharge/lastbar`
 
if [ $curbar -eq $prevbar ]; then
#exit without doing anything
echo `date | awk '{print $4}'`
exit
else
echo $curbar
#set pattern to current bar level
if [ $curbar -eq 8 ];then 
cp /home/user/.ledcharge/mce.8.ini /etc/mce/mce.ini
fi
if [ $curbar -eq 7 ];then 
cp /home/user/.ledcharge/mce.7.ini /etc/mce/mce.ini
fi
if [ $curbar -eq 6 ];then 
cp /home/user/.ledcharge/mce.6.ini /etc/mce/mce.ini
fi
if [ $curbar -eq 5 ];then 
cp /home/user/.ledcharge/mce.5.ini /etc/mce/mce.ini
fi
if [ $curbar -eq 4 ];then 
cp /home/user/.ledcharge/mce.4.ini /etc/mce/mce.ini
fi
if [ $curbar -eq 3 ];then 
cp /home/user/.ledcharge/mce.3.ini /etc/mce/mce.ini
fi
if [ $curbar -eq 2 ];then 
cp /home/user/.ledcharge/mce.2.ini /etc/mce/mce.ini
fi
if [ $curbar -eq 1 ];then 
cp /home/user/.ledcharge/mce.1.ini /etc/mce/mce.ini
fi
if [ $curbar -eq 0 ];then 
cp /home/user/.ledcharge/mce.0.ini /etc/mce/mce.ini
fi

#remove and reset lastbar variable
rm /home/user/.ledcharge/lastbar
touch /home/user/.ledcharge/lastbar
echo $curbar >> /home/user/.ledcharge/lastbar

fi

#now restart mci
initctl stop mce
sleep 2
initctl start mce

exit
__________________
*Consumer*, not a developer! I apologize for any inconvenience.
My script to backup /home and /opt
Samsung Galaxy S Vibrant, Huawei S7, N900(retired), N800(retired)
 

The Following User Says Thank You to lemmyslender For This Useful Post:
Posts: 429 | Thanked: 217 times | Joined on Apr 2010 @ Dubai
#24
is it possible to add more profiles to the mce.ini

like over here
Code:
# Priority (0 - highest, 255 - lowest)
# Policy - 0 only play pattern when the display is off
#          1 play pattern even when the display is on
#          2 only play pattern when the display is off, including acting dead
#          3 play pattern even when the display is on, including acting dead
#          4 only play pattern if the display is off, or if in acting dead
#          5 always play pattern, even if vibrator disabled in profiles
# Timeout in seconds before pattern is disabled, 0 for infinite
# Repeat count, 0 for infinite
# AcceleratePeriod time in millisecond
# OnPeriod time in milliseconds
# BreakPeriod time in milliseconds
# OffPeriod time in milliseconds
# Speed from 1 to 255
PatternIncomingCall=1;3;0;0;30;970;0;1000;180
PatternIncomingMessage=4;3;2;1;30;360;0;100;180
PatternPowerKeyPress=5;5;1;1;0;16;0;16;128
PatternTouchscreen=11;3;0;1;23;0;15;50;255
PatternChatAndEmail=10;3;0;1;23;0;15;50;255
if you notice the first number is the priority so this can make the phone notification LED with higher priority over the battery level indicator

then if the profiles are added we can use the script in the post before to force these profiles to be loaded
thus our problems solved

im not sure about all this
its just pure assumptions so far
i just dont have a spare N900 to test with

but i promise to work with this for now hopefully we can make this come true!!
__________________
N900 @850Mhz
My N900 changed my life and made it ALOT easier!
 
Reply


 
Forum Jump


All times are GMT. The time now is 08:50.