maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] LockScreenQuotes for N9 (Alpha ver of USbS avalable) (https://talk.maemo.org/showthread.php?t=81443)

ejasmudar 2012-01-08 18:17

[Announce] LockScreenQuotes for N9 (Alpha ver of USbS avalable)
 
2 Attachment(s)
As I have mentioned in this thread, I was working on a python script to display random quotes from a textfile onto the Lock/Standby Screen.
I have now packaged it, but please remember this is still beta testing only.

PREREQUISITE
1. You should modify the file mentioned in this post so as to enable Operator Logo.
2. ie, under "LockScreen MImageWidgetStyle#LockScreenLowPowerModeOperatorLo go"
change the entries to as follows (if not present, add):
Code:

minimum-size: 45mm 45mm;
maximum-size: 45mm 45mm;

INSTRUCTIONS
1. Install attached deb
2. Open Terminal
3. Enter the command:
Code:

LockScreenQuotes.sh
Now lock the device and if everything has gone right it should be showing a quote under the clock. [see attachment]

NOTES
1 As of now, I've disabled running the script in background mode (ie, u will have to keep terminal open for the script to show random quotes). This is because this is still a beta version and I want to know if/what errors popup. Silent version and autostart will be included in later versions.
2 Most of the settings can be changed by editing the file /home/user/LOCKSCREENQUOTES/LockScreenQuote.py. It is pretty well commented and must be self explanatory.
3 You can use your own font/text file. Just note that the text file should have one quote per line and must not have wierd characters (I'll try to fix this later)
4 Python, python-imagin and python-gconf are the dependencies. The application manager should automatically install this. If not please inform me. You can also install it manually by apt-get.

FINALLY, I'M REMINDING YOU AGAIN THAT THIS IS ONLY A BETA SOFTWARE AND USE IT WITH CAUTION.

UPDATE: 7/5/2012
See this post for a newer version(not packaged yet) http://talk.maemo.org/showpost.php?p...0&postcount=38

aRTee 2012-01-10 22:22

Re: [Announce] LockScreenQuotes for N9 (BetaTesters Needed)
 
Great, love it, thanks a lot!

Some feedback:
I have some longer and some shorter quotes, and your mechanism to select a quote is based on randomly picking a position in the file, then taking the following full line - this way, the quotes after the longest quotes are favoured...

Otherwise, I made the quote image max size bigger (450x450), and chose green as text colour (reducing total luminocity and power drain by 50%) to accomodate for the longer quotes...


Keep up the good work!

ejasmudar 2012-01-10 23:10

Re: [Announce] LockScreenQuotes for N9 (BetaTesters Needed)
 
Thanks for the feedback!

You're right about the random selection. Hmm... so just selecting a random line would be better, right?

Now that I know it is working, I'll provide an update with autostart and better config files.

aRTee 2012-01-11 10:59

Re: [Announce] LockScreenQuotes for N9 (BetaTesters Needed)
 
OH btw, forgot to mention that I didn't manage to install it, so I just put the files in the respective locations.

I tried to install it, but had do use the command line only (ssh - my better half was reading an ebook, so I couldn't use the phone itself) and I don't have much experience with Debian, so when the dpkg command failed, I just placed the files where they belonged as per the .deb file...

BTW I never saw any error when using the app (from the cli), all is fine there.

aRTee 2012-01-14 13:58

Re: [Announce] LockScreenQuotes for N9 (BetaTesters Needed)
 
Additional idea, it would be cool to change the text colour according to the battery level...:
magenta/blue for high levels (00FFFF)
below 50% or so green (00FF00)
below 25% or so yellow (FFFF00)
and below 10% or so red (FF0000)

Getting the battery percentage is as easy as
lshal | grep percent
which on my device tells me:
battery.charge_level.percentage = 49 (0x31) (int)
perhaps there's an easier way, reading a file from /proc or so (I have 0 skill with python, no idea how to incorporate the above lshal command into this script).

Note also that green will render the sharpest text (I put longer quotes so I use a smaller font for things to fit).

www.rzr.online.fr 2012-01-14 14:59

Re: [Announce] LockScreenQuotes for N9 (BetaTesters Needed)
 
I can try to rebuild from sources ...

aRTee 2012-01-14 15:49

Re: [Announce] LockScreenQuotes for N9 (BetaTesters Needed)
 
rzr, are you in the right thread..?

Anyway, I modified things as such:
added this line to /usr/bin/lockscreenquotes.sh
lshal | grep battery.charge_level.percentage | awk '{print $3}' > /home/user/lsq/batterylevel.txt
(note: I used the dir lsq for the user stuff)


and these to the python script somewhere at the top:

# read batterylevel from file
file = open("batterylevel.txt")
BATTERYLEVEL = int(file.readline())
file.close()



#BATTERYLEVEL colour change
if BATTERYLEVEL < 10:
FONT_COLOR = (255, 0, 0)
elif BATTERYLEVEL < 20:
FONT_COLOR = (255, 255, 0)
elif BATTERYLEVEL < 50:
FONT_COLOR = (0, 255, 0)
elif BATTERYLEVEL < 90:
FONT_COLOR = (0, 255, 255)
else:
FONT_COLOR = (255, 255, 255)

ejasmudar 2012-01-15 06:07

Re: [Announce] LockScreenQuotes for N9 (BetaTesters Needed)
 
Instead of dpkg -i, did u try installing from file filemanager directly? It should work.

Battery percentage is a brilliant idea and also easy to implement. I'm currently busy with some admission proceedures, so no time frame, but I'll try to do it soon. Thanks for testingit out BTW.

ejasmudar 2012-01-15 06:11

Re: [Announce] LockScreenQuotes for N9 (BetaTesters Needed)
 
To-Do
Remove the quotes from lock screen when uninstalled (now it still remains)
Put all configs into a config file for easy modifying
Option for basing colour on battery level or fixed colour
An item in settings to modify configs with GUI
Auto Start on boot

Anything I have missed?

aRTee 2012-01-15 15:59

Re: [Announce] LockScreenQuotes for N9 (BetaTesters Needed)
 
I think the first thing I tried is to install via file manager, not sure anymore though - messed about too much to remember...

BTW I like your todo list, looks good to me.


All times are GMT. The time now is 21:24.

vBulletin® Version 3.8.8