03-25-2014, 07:41 PM | #1 |
Connoisseur
Posts: 74
Karma: 889004
Join Date: Mar 2014
Device: Kindle PW2
|
Front Light Master extension
Front Light Master v0.2 (2014-04-14) The "Front Light Master" is an extension for the Kindle Paperwhite 1 and 2 models (i.e. the ones that have a front light). Based on the idea of the FLToggle extension by DuckieTigger (a copy of which you can download at https://www.mobileread.com/forums/sho...&postcount=116) it adds multiple more features. Same features as FLToggle:
Additional features:
After power-on, if you change the brightness manually, no auto-changes will be made to the brightness until you turn the Kindle off again. Auto-changes will only happen when you set a schedule for the current time. This gives you full control over your Kindle's frontlight brightness. Disclaimer As of version 0.2, this extension has only been tested on a Kindle Paperwhite 2. If you get this extension to run on your device, please provide feedback here. It is recommended to test the extension manually prior to activating auto control. To do so, select "Test auto-control" from the Front Light menu in KUAL. This will run the controller in the background. It can be stopped via "Kill test auto-control" or by rebooting your Kindle. If you notice any unwanted side effects, simply restart your Kindle. Either way, as usual please be advised that you are using this extension on your own risk. Prerequisites
Installation Unzip the downloaded file into the extensions folder (/mnt/us/extensions when using SSH, otherwise the extensions folder at root of the Kindle volume when connected to your PC). Configuration Edit frontlightmaster/bin/config.sh, all available options are described here. Note that you MUST use an editor that supports Unix line endings. On Windows, use e.g. the free notepad++ application. Use Run KUAL and enter the "Front Light" section. You will see the following options:
When auto-control is active, the menu items will disappear and be replaced by "Auto-Control - disable", which will disable the auto-control. All these functions can be done also on a terminal on your Kindle (e.g. via ssh). Just go to /mnt/us/extensions/frontlightmaster/bin where you will find the following scripts:
Uninstalling It is recommended to disable auto-control via KUAL or the disable.sh script prior to deleting the folder from the extensions directory. Last edited by peterson; 04-14-2014 at 04:43 PM. Reason: v0.2 |
03-25-2014, 07:44 PM | #2 |
Connoisseur
Posts: 74
Karma: 889004
Join Date: Mar 2014
Device: Kindle PW2
|
This is a very first version. I tested it the last couple of hours and it seems to work fine. Please let me know if you miss a feature or find a bug.
|
Advert | |
|
03-29-2014, 12:02 PM | #3 |
Junior Member
Posts: 2
Karma: 10
Join Date: Mar 2014
Device: K3, K4, KPW2
|
Hi,
I've downloaded it, I will test it on my pw2 (v5.4.2). I'm intrested on the auto control function, with the schedule ! Thanks ! |
03-30-2014, 02:32 PM | #4 |
Connoisseur
Posts: 58
Karma: 6090
Join Date: Oct 2013
Device: PW
|
Thanks!
|
04-08-2014, 10:22 AM | #5 |
Junior Member
Posts: 2
Karma: 10
Join Date: Mar 2014
Device: K3, K4, KPW2
|
Hi,
I'm using it on my PW2 for one week, I have no problems. Tonight, I've changed some settings, I will test it tomorrow. |
Advert | |
|
04-10-2014, 04:17 PM | #6 |
Junior Member
Posts: 5
Karma: 10
Join Date: Apr 2014
Device: Kindle PW2
|
Hi,
I would like to use your extension but I don't want to use the scheduler - is it enough to comment out the section in config.sh in order to disable scheduler? |
04-10-2014, 05:15 PM | #7 | |
Lexically Impaired
Posts: 28
Karma: 200518
Join Date: May 2008
Device: PW2
|
Quote:
@peterson, I too would also like to use this extension without the scheduler. The scheduler basically doesn't save my current light setting in between turning it off an back on...it just overrides it. Here's the ideal if it is possible thank you in advance! Basically I want the extension to 1) When turning on PW2, have FL be ON for X seconds (X is configurable and that currently works). and then AFTER X seconds 2) Restore PREVIOUS light setting (which is saved when turning OFF PW2 (Screensaver mode). 3) Check in Background if I set light below minimum Y amount (Y is configurable and that currently works) to turn OFF the FL. 4) Whenever SS mode is activated, save current FL setting. 5) option for scheduler to override above options is current (as of 4/10/2014) operation but option to turn off scheduler Then go back to 1) and repeat Maybe I have the logic wrong and there isn't a need to save the current setting. Just not have the scheduler override it perhaps? Last edited by arcadesdude; 04-10-2014 at 05:20 PM. |
|
04-13-2014, 06:01 PM | #8 |
Connoisseur
Posts: 74
Karma: 889004
Join Date: Mar 2014
Device: Kindle PW2
|
@arcadesdude / @phoenix_pl : To not use the scheduler, just don't define a schedule. I.e. set
Code:
SCHEDULE="" |
04-14-2014, 09:58 AM | #9 | |
Lexically Impaired
Posts: 28
Karma: 200518
Join Date: May 2008
Device: PW2
|
Quote:
That happens with schedule both commented out and with it set to an empty string value. |
|
04-14-2014, 04:44 PM | #10 |
Connoisseur
Posts: 74
Karma: 889004
Join Date: Mar 2014
Device: Kindle PW2
|
You are right. I've uploaded a new version that should fix this issue (it also has the SCHEDULE disabled by default).
Anybody updating, please make a backup of your config.sh. |
04-14-2014, 06:27 PM | #11 |
Lexically Impaired
Posts: 28
Karma: 200518
Join Date: May 2008
Device: PW2
|
New version is working perfectly! I tested on various light levels then turning off and back on and waiting out the delay. It works as you intended now and is exactly how I like it -- better than 'stock/amazon' because it can go off and I can use the default slider to turn it off/on without having to go into KUAL once autocontrol is enabled. It even survives a reboot. Thanks again!
|
04-14-2014, 09:45 PM | #12 |
Lexically Impaired
Posts: 28
Karma: 200518
Join Date: May 2008
Device: PW2
|
The only UI or possible bug in this new 0.2 version is that if you have the light off then turn off the pw2, then turn it on, you'll have your 10 seconds of light to adjust the backlight...but after the 10 seconds the light will go off again.
You can't change the light level when first turning it on since it gets reset to what the level was before it was turned off (including off). Maybe something that checks if the current light level setting is not equal to the remembered (when turning off) light level setting test would allow that to be overridden. I guess it would also have to be not equal to the initial (when turning on) light setting value. Hrm.... |
04-15-2014, 01:20 AM | #13 |
Lexically Impaired
Posts: 28
Karma: 200518
Join Date: May 2008
Device: PW2
|
I managed to modify your script in a way that gives the UI that I want from this to be perfect now.
So when I turn it on, the minimum brightness I set it to 6 (since I read on 5 usually and lower). It will turn on to 6 for 10 seconds and then it will either restore the original brightness (or screen off) OR, if the brightness was changed after first turning it on (anything other than 'level 6') it will keep that new brightness setting. This allows me to change the brightness level without having to wait 10 seconds for it to first to restore the old level and then set the new level. So if the light was off, for example, and I'm in a dark room, it will now be set to level 6 and then if I change it (say to 5 or 4) it will not turn off after 10 seconds and then require me to set the level as it would have before without my small modification. This way if the level is set other than 6 (minimumbrightnesslevel) then it will stay that way. Here's what I changed to acheive this in frontlightmaster.sh: Code:
# if brightness to use is really low, set the minimum brightness and wait a bit if [ $(get_brightness_to_use) -lt $MINIMUMBRIGHTNESSONSTART ]; then # remember brightness BRIGHTNESSONSTART=$(get_brightness_to_use) logger "Set minimum brightness to $MINIMUMBRIGHTNESSONSTART for $MINIMUMBRIGHTNESSONSTARTTIME seconds" set_brightness $MINIMUMBRIGHTNESSONSTART lipc-wait-event -s $MINIMUMBRIGHTNESSONSTARTTIME com.lab126.powerd goingToScreenSaver || true if [ $(get_current_brightness) -eq $MINIMUMBRIGHTNESSONSTART ]; then # reset brightness set_brightness $BRIGHTNESSONSTART fi LASTBRIGHTNESS=$(get_current_brightness) else # we start with the brightness that is currently set, this will update in a bit LASTBRIGHTNESS=$(get_current_brightness) fi Code:
if [ $(get_current_brightness) -eq $MINIMUMBRIGHTNESSONSTART ]; then # reset brightness set_brightness $BRIGHTNESSONSTART fi |
04-15-2014, 02:41 PM | #14 |
Lexically Impaired
Posts: 28
Karma: 200518
Join Date: May 2008
Device: PW2
|
The only improvement I could suggest at this point would be reguarding this line of code in frontlightmaster.sh:
Code:
lipc-wait-event -s $MINIMUMBRIGHTNESSONSTARTTIME com.lab126.powerd goingToScreenSaver || true If I'm correct, then that line of code waits until the $MINIMUMBRIGHTNESSONSTARTTIME has elapsed before continuing to process the next line of code. This means if the brightness is changed during that $MINIMUMBRIGHTNESSONSTARTTIME (10 seconds say) then there isn't any way of knowing if the brightness slider was changed and then set back to the $MINIMUMBRIGHTNESSONSTART level. So if you have the light off, and min brightness set to 5, when you turn it on the PW2 will be at brightness level 5 for 10 seconds during which if you increase and then decrease the brightness + 1 - 1 so it remains at 5 (or whatever $MINIMUMBRIGHTNESSONSTART is set to) then the light would go off since it didn't detect a change in brightness (manually changing the slider). If that line of code was a do while loop of some sort that executed for $MINIMUMBRIGHTNESSONSTARTTIME then it could detect current brightness being different from $MINIMUMBRIGHTNESSONSTART at any point within the 10 seconds (MINIMUMBRIGHTNESSONSTARTTIME) and then chose not to reset the light to the former saved off value (off in my example above). Any ideas on the above? |
04-16-2014, 04:58 AM | #15 |
Connoisseur
Posts: 74
Karma: 889004
Join Date: Mar 2014
Device: Kindle PW2
|
Your first code change should be sufficient. The only case your first code change does not cover is when the user changes the brightness, and then changes it back to the $MINIMUMBRIGHTNESSONSTART. This should be such a rare event that I believe we can ignore it.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Front light on PB Touch Lux | walan | PocketBook | 1 | 11-23-2013 09:52 AM |
What is your main use for your front light | speakingtohe | General Discussions | 43 | 09-15-2013 12:45 PM |
Kindle PW front light... | freezer2k | Amazon Kindle | 52 | 09-09-2013 10:37 AM |
I'm annoyed - Extension/angle cords don't activate Vox charge light | TonyToews | Kobo Tablets | 12 | 12-09-2011 03:37 PM |
Front Light Idea | drgnbear | Sony Reader | 10 | 02-13-2007 07:27 PM |