Notices


Reply
Thread Tools
Posts: 34 | Thanked: 46 times | Joined on Jan 2012 @ Germany
#11
Hey, i just installed your mod. I love it.

I am sorry but I am not very good in python, but as said the choice of the next quote is "unfair", picking quotes after long quotes more often. Also, the very first quote in the file cannot be chosen at all (Dirty workaround: fill the first line of the file with random letters, about as long as a normal quote).

So, picking a line number would be better. An alternative Workaround would probably be to make a script which is reading through the quotes file, finding the longest quote, and then extends every single line in the file with spaces until all lines have the same length (and equal chances to get picked). This is, as said, only a workaround and requires the user to run his quote file through the conversion script once before using your mod.
 

The Following User Says Thank You to damaltor For This Useful Post:
Posts: 188 | Thanked: 90 times | Joined on Sep 2006
#12
Ahh, where is the do-it-yourself-spirit these days?

I had never seen python, yet I managed to even change the colour with IF statements (wow, python doesn't have CASE), and this was my first bit of programming in what, 10 years...

Anyway, I put the level for white (255, 255, 255) at 95%, so you can use it as a sort of battery full indication when charging.
I have to check what the optimum level is, it sometimes finishes charging at 98%, so I don't want to put it at 100%...

As for random selection of lines but with equal probability, I just found this:
http://www.bryceboe.com/2009/03/23/r...s-from-a-file/
__________________
If I said something useful, please hit the 'Thanks!' link related to that post.
 
Posts: 34 | Thanked: 46 times | Joined on Jan 2012 @ Germany
#13
yeah I know.. I should have at least tried it.

Charging does not actually stop at 9x percent, in fact it will charge to 100, then let the battery drain to like 95, load again and so on. This is the best possible way to handle the battery for not overcharging it, but still have a (nearly) full battery after unplugging the charger.

I like the idea of changing the color according to the battery. This should be made a config option in the script.

I messed around with the script now for a while to make it autostarting. Didn't find a solution which made me happy though. I started it now with nohup, so I do not have to have an open terminal all the time but still have the quote updated.

Also, I personally would like to see the quote updated at every time ending with a zero... Cant really tell why, but it would be nice. But as that is a bit more work to do (always poll the time? poll the time until the first zero is reached, then "sleep 600"? And what about people who would like to have, like, 7 minutes between quotes??), it is definitely not important.

I find it funny that the normal non-root user is able to mess around with gconf in this system.

Where did you get the quote file from?
 
ejasmudar's Avatar
Posts: 800 | Thanked: 957 times | Joined on Sep 2010 @ India
#14
Yes, i'll modify the logic for selection of quotes to be more "fair". Thanks to aRTee for the link

Yes the colour based on battery level will be optional, so that you need chose it only if required.

Autostarting is possible, but i need to figure it out. nohup or & can be used to run the script silently now. I did not mention that because I want to see if the script throws up errors. I've found that the encoding of the script can sometimes throw up errors (esp with foreign languages).

Quote update time... Let me see if I can make this configurable easily without having the full script run in the memory always. (That is why I use a sh script to call the python script. Also, this way, we can modify the python script without killing the process)

Gconf is basically for settings. That is why users can modify it without root privileges.

The quote file I compiled from different sources like the old fortune database, other quote files etc. Hmmm maybe I should include a mention of the sources in the script...
__________________
My Device History:Nokia 3510 > SE T230 > Nokia 6600 > HP2210 > SE p910i > SE p990i > N95 > I-mate 9502 > itouch > Nokia N900 > ? N9
My apps for N900:
Conversation Modder

My apps for N9:
LockScreenQuotes
USbS


If you feel I have helped you, don't forget to press Thanks!
 
Posts: 188 | Thanked: 90 times | Joined on Sep 2006
#15
Dalmator, nohup..? Please explain how you start it now.
I was looking into getting it started automatically at boot, but didn't finish (looking at daemons).
I just start from the terminal, with & after it - if the terminal gets closed, you're saying it won't keep running?

On changing quotes, I was thinking, it should change quote a few moments (10s of seconds or so) after being locked. To explain: user takes phone because of an incoming message, or wants to send something; realizes there was a cool quote, finishes reading/writing/whatnot, locks the screen and wants to read the quote (remember, the quotes I use are much longer, some 5 lines of text; the user may also want to show the quote to someone else), so it should still be there.

The next time (a minute later, an hour later, whatever) there should be a different quote; one can reasonably assume that any quote on the idle screen got seen before and / or after unlocking the device.
In between, not so much.

So I would like to know, is there some way (daemon, trigger, whatever) to activate the script to change the quote let's say 20 secs after the screen is locked, but if in the mean time the screen is unlocked, the 20 sec counter should be stopped and reset...?
__________________
If I said something useful, please hit the 'Thanks!' link related to that post.
 
afaq's Avatar
Posts: 1,038 | Thanked: 1,408 times | Joined on Feb 2010 @ London
#16
This is excellent. Great work esjasmudar.
__________________
Graphic and Calligraphy Designer
check out my site www.afaqali.com
 
Posts: 34 | Thanked: 46 times | Joined on Jan 2012 @ Germany
#17
Originally Posted by aRTee View Post
Dalmator, nohup..? Please explain how you start it now.
it is fairly easy. use the therminal or ssh into your phone, and type:

nohup LockScreenQuotes.sh &

to load the script. after that, you can close your user session without stopping the script. i did only test that by ssh so far, but it should work just as fine with the terminal inside your mobile.



some more things I changed:
- changed all filenames to lower case
- changed the path to a short lowercase one (/home/user/lsq)
- did not put the shell script into /usr/bin, as it can easily be started in home dir
- removed the colon at the start f the pictures filename. why hide this beauty?
- changed the size of the graphic for several reasons:
1. All quotes occupy a max of 3, maybe 4 or even 5 lines. So a hight of 20 mm seemed enough for me, maybe 25. we'll see.
2. As there is not so much black space in the picture, the lockscreen clock and quote can be placed more randomly on the lockscreen. this looks better, and...
3. makes use of more different oleds, as if the quote could only be (nearly) in one place all the time. as you might know, oleds wear out "quickly" (meaning 5000 - 10,000 hours of glowing, so dont be scared), especially blue ones loose their power faster than the ther colors. though it does not really make a huge difference, the load is taken off the oleds in the center, where the quote sits most of the time if we use a 45x45 image.
 
Posts: 188 | Thanked: 90 times | Joined on Sep 2006
#18
Ok, thanks for the explanation, I also read up on nohup, clear to me. I didn't realize that the script would exit after exiting the terminal.
Another option would be to create a button on the homescreen to start the script, but the real solution would be to have the script started automatically. Any ideas welcome.

As for the dot to hide the file, it's just to avoid it showing up in the gallery and browsers I guess.


When it comes to oleds, you do realise the screen goes off when covered, right?
Just cover the proximity sensor (right of the Nokia brand name on the front) with your thumb, and the oled screen will turn off. (Yeah, Nokia guys are that good... people seem to have written them off a bit early I'd say...)


Other than that, I agree it's good to take into account that the oleds will wear out according to their 'on'-time.
__________________
If I said something useful, please hit the 'Thanks!' link related to that post.
 
Posts: 34 | Thanked: 46 times | Joined on Jan 2012 @ Germany
#19
yeah.. as said, it doesnt really make a huge difference, but it is not a huge change so why not implement it. i usually do not cover the sensor, as i like to see the clock on my phone lying around.

leaving the dot in the filename becuase of the gallery is a good point.
 

The Following User Says Thank You to damaltor For This Useful Post:
caco3's Avatar
Posts: 560 | Thanked: 423 times | Joined on May 2010 @ Switzerland
#20
I like the idea of your script!
I am thinking of addabting it to show daily bible verses on the lock screen.

I do only have an N950, so I was wondering, is the screen of the N9 always on? Or is it like on the N950 were you have to double tab it?
__________________
On N9 check out this:
CacheMe 4 the N9, a geocaching client / MiniBible, a bible viewer / TheWord brings daily bible verses onto your phone / BatteryGraph to monitor the battery drainage / doublepress2unlock to unlock your phone with a double press onto the power button / GPRS Data Usage to monitor your GPRS data usage /
and more...

On N900 check out this: SleepAnalyser to analyse your sleep movements / PasswordMaker a for a password generator
 
Reply


 
Forum Jump


All times are GMT. The time now is 10:31.