View Single Post
Old 05-24-2016, 11:29 PM   #11
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773670
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Okay, I suppose we could post this attachment with KUAL too, but here it is (for relevancy). Extract the file to your kindle. It expands into:
extensions/frontlight_control/config.xml
extensions/frontlight_control/menu.json


menu.json:
PHP Code:
{
    
"items": [
        {
        
"name""Frontlight Control",
        
"priority"0,
        
"items": [
            {
"name""Frontlight OFF""priority"1"action""echo 0 > /sys/devices/platform/imx-i2c.0/i2c-0/0-003c/max77696-bl.0/backlight/max77696-bl/brightness""params"""},
            {
"name""Frontlight Low""priority"1"action""echo 1 > /sys/devices/platform/imx-i2c.0/i2c-0/0-003c/max77696-bl.0/backlight/max77696-bl/brightness""params"""},
            {
"name""Frontlight Medium""priority"1"action""echo 500 > /sys/devices/platform/imx-i2c.0/i2c-0/0-003c/max77696-bl.0/backlight/max77696-bl/brightness""params"""},
            {
"name""Frontlight High""priority"1"action""echo 999 > /sys/devices/platform/imx-i2c.0/i2c-0/0-003c/max77696-bl.0/backlight/max77696-bl/brightness""params"""}
        ]
        }
    ]

config.xml:
PHP Code:
<?xml version="1.0" encoding="UTF-8"?>
<extension>
    <information>
        <name>Frontlight Control</name>
        <version>1.0</version>
        <author>geekmaster</author>
        <id>pw_led_off</id>
    </information>
    <menus>
        <menu type="json" dynamic="true">menu.json</menu>
    </menus>
</extension>


I tested it on my PW2 and my PW3, in a very dark room, and it does indeed turn the frontlight completely off (when that option is selected). It also provides options for minimum brightness (1), medium brightness (500) , and maximum brightness (999).

Beware that when you kindle resumes from screensaver mode, it returns to whatever brightness was last set with the control panel slider, so the framework must be storing it somewhere. There may be another method of controlling brightness that uses that value instead, but then we may be subject to the original minimum brightness level.

Enjoy!
Attached Files
File Type: gz frontlight_control.tar.gz (573 Bytes, 430 views)
geekmaster is offline   Reply With Quote