Xfce Forum

Sub domains
 

You are not logged in.

#1 2014-06-14 01:37:21

sonwon
Member
Registered: 2014-06-14
Posts: 20

[Solved] Keyboard Back-light not adjustable

Xfce Version = 4.11.1 (Xfce 4.10)
Xubuntu 14.04
ASUS laptop G53J

Pressing the function key and F3 (XF86KbdBrightnessDown) and F4 (XF86KbdBrightnessUp) doesn't change the keyboard brightness.  Any ideas how to fix?  This was working with Xubuntu 13.10.

Offline

#2 2014-06-14 02:43:02

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,949

Re: [Solved] Keyboard Back-light not adjustable

Unfortunately, this isn't an Xfce issue. Most likely its a regression issue with the newer kernel or one of the system components (kernel module? acpi?).

I see you've already created a bug report on launchpad - wait to see if this gets you some results.

Also found this PPA (from: https://launchpad.net/~flozz/+archive/flozz) that has a trusty package for "asus keyboard backlight". I don't have one of these laptops nor have tried this PPA, so YMMV.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2014-06-14 12:26:36

sonwon
Member
Registered: 2014-06-14
Posts: 20

Re: [Solved] Keyboard Back-light not adjustable

Thank you for the reply.  I suspected as much.  I wish I knew more about what happens when I press those keys to trigger the brightness change.  I am assuming the code is in C or a derivative and could compare those sections of sources myself to see what has changed between 13.10 and 14.04. 

Also I saw the flozz link and considered trying that however I cannot read the code so I hesitate giving it root access.

All the best to you!

Offline

#4 2014-06-14 12:51:16

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,949

Re: [Solved] Keyboard Back-light not adjustable

Here is an interesting thread. Do you have a /sys/class/leds/asus::kbd_backlight/brightness file on your system? If so does echoing a value of 0, 1 or 2 into that file change the keyboard backlight?

echo 0 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness
echo 1 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness
echo 2 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2014-06-14 14:07:02

sonwon
Member
Registered: 2014-06-14
Posts: 20

Re: [Solved] Keyboard Back-light not adjustable

Yes!!! These work perfectly 0-3, now I am close to being able to write my own code to change the brightness.  I see cat will read the value so I should be able to write a script to increase or decrease the light.  I did notice the asus::kbd_backlight folder is redirected.  Couldn't really tell where too, not sure if that matters.  Anyway time to self teach myself the scripting language (Looks like that would be GNU bash).

Thank you again.

Offline

#6 2014-06-14 22:57:36

sonwon
Member
Registered: 2014-06-14
Posts: 20

Re: [Solved] Keyboard Back-light not adjustable

I've been doing some investigation and have discovered the following. If I perform these commands the back-light changes:

echo 0 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness
echo 1 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness
echo 2 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness
echo 3 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness

Also there is a script called /etc/acpi/asus-keyboard-backlight.sh

I thought maybe this script wasn't being called and remapped the keys to the script and it still would not work. So I manually entered each script line and tested which worked fine accept I couldn't test this line:

if [ "$1" = down ]; then

I assume the $1 variable is only passed when called by the keyboard handler or is it possible this is the problem? How do I discover if this is being passed? How do I figured out if the script is even being called by the keyboard handler?

I don't think the script is being called when pressing the function + F3 or F4 keys.  Where is this controlled, inside of XFCE or somewhere else?  I assume there is a map somewhere.

Offline

#7 2014-06-15 11:27:09

PaperNick
Member
Registered: 2013-05-26
Posts: 106

Re: [Solved] Keyboard Back-light not adjustable

I remember having a similar issue on one of my laptops. I discoverd xbacklight. You can open a Terminal window and try one of those commands to see if it will work for you:

Increase the brightness with (10%):

xbacklight -inc 10

Decrease it with (10%):

xbacklight -dec 10

If it works ok, you can remap "XF86KbdBrightnessUp" and "XF86KbdBrightnessDown" from Settings Manager -> Keyboard -> Applications shortcuts.


If you want your PC to start with a specific level of brightness, you can create a startup entry in Settings Manager -> Session and Startup -> Application Autostart. Here is an example:

xbacklight -set 20

(assuming you want 20%)

Last edited by PaperNick (2014-06-15 11:31:15)

Offline

#8 2014-06-15 11:50:12

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,949

Re: [Solved] Keyboard Back-light not adjustable

sonwon wrote:

I've been doing some investigation and have discovered the following. If I perform these commands the back-light changes:

echo 0 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness
echo 1 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness
echo 2 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness
echo 3 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness

Also there is a script called /etc/acpi/asus-keyboard-backlight.sh

I thought maybe this script wasn't being called and remapped the keys to the script and it still would not work. So I manually entered each script line and tested which worked fine accept I couldn't test this line:

if [ "$1" = down ]; then

I assume the $1 variable is only passed when called by the keyboard handler or is it possible this is the problem? How do I discover if this is being passed? How do I figured out if the script is even being called by the keyboard handler?

I don't think the script is being called when pressing the function + F3 or F4 keys.  Where is this controlled, inside of XFCE or somewhere else?  I assume there is a map somewhere.

If you look at /etc/acpi/events/asus-keyboard-backlight-up and /etc/acpi/events/asus-keyboard-backlight-down, you'll see the calling scripts. You'll also see which event hotkey initiates the script (defaults are ATKD 000000c4 (up) and ATKD 000000c5 (down)). In a terminal window, run:

acpi_listen

...then press the key combination for keyboard brightness up. Do the event codes match?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#9 2014-06-15 13:53:55

sonwon
Member
Registered: 2014-06-14
Posts: 20

Re: [Solved] Keyboard Back-light not adjustable

ToZ wrote:

...then press the key combination for keyboard brightness up. Do the event codes match?

Yes and no, the codes from acpi_listen are:

hotkey ATK0100:00 000000c5 00000005
hotkey ATK0100:00 000000c4 00000006

The codes in the scripts are:

event=hotkey ATKD 000000c5
action=/etc/acpi/asus-keyboard-backlight.sh down

event=hotkey ATKD 000000c4
action=/etc/acpi/asus-keyboard-backlight.sh up

I don't know if the secondary number string is processed?  Never mind I see now that the secondary string is just a counter.

Also, when I try to :/etc/acpi$ sudo asus-keyboard-backlight.sh up I get 'command not found'

Last edited by sonwon (2014-06-15 13:54:15)

Offline

#10 2014-06-15 15:01:37

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,949

Re: [Solved] Keyboard Back-light not adjustable

sonwon wrote:

Also, when I try to :/etc/acpi$ sudo asus-keyboard-backlight.sh up I get 'command not found'

It doesn't find the path because in Linux, the current path isn't necessarily in the $PATH variable. Try:

sudo ./asus-keyboard-backlight.sh up

... the "./" means 'in the current directory'.

Yes and no, the codes from acpi_listen are:

hotkey ATK0100:00 000000c5 00000005
hotkey ATK0100:00 000000c4 00000006

The codes in the scripts are:

event=hotkey ATKD 000000c5
action=/etc/acpi/asus-keyboard-backlight.sh down

event=hotkey ATKD 000000c4
action=/etc/acpi/asus-keyboard-backlight.sh up

First make a backup of those files then change the "event" line to match up with the acpi codes:

event=hotkey ATK0100:00 000000c5
action=/etc/acpi/asus-keyboard-backlight.sh down

...and

event=hotkey ATK0100:00 000000c4
action=/etc/acpi/asus-keyboard-backlight.sh up

...you'll need to restart acpid for it to take effect:

sudo service acpid restart

I don't know if the secondary number string is processed?  Never mind I see now that the secondary string is just a counter.

I do no believe the second number is processed.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#11 2014-06-15 15:24:43

sonwon
Member
Registered: 2014-06-14
Posts: 20

Re: [Solved] Keyboard Back-light not adjustable

ToZ wrote:

It doesn't find the path because in Linux, the current path isn't necessarily in the $PATH variable. Try:

sudo ./asus-keyboard-backlight.sh up

... the "./" means 'in the current directory'.

First make a backup of those files then change the "event" line to match up with the acpi codes:

event=hotkey ATK0100:00 000000c5
action=/etc/acpi/asus-keyboard-backlight.sh down

...and

event=hotkey ATK0100:00 000000c4
action=/etc/acpi/asus-keyboard-backlight.sh up

...you'll need to restart acpid for it to take effect:

sudo service acpid restart

I don't know if the secondary number string is processed?  Never mind I see now that the secondary string is just a counter.

I do no believe the second number is processed.

Bingo!!!  Changing the codes in the event scripts fixed the issue.  The ./ also worked.  I'll document the fix so if this happens again I'll know what to do.  All is good now, thank you much for your help!

Offline

#12 2014-06-15 15:36:28

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,949

Re: [Solved] Keyboard Back-light not adjustable

Good to hear.
One thing to keep in mind is that if the acpid package ever gets updated, these changes you make may get overwritten. You should continue through with the bug report you created so that it can get fixed properly so no workaround is required.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#13 2014-06-15 15:38:09

sonwon
Member
Registered: 2014-06-14
Posts: 20

Re: [Solved] Keyboard Back-light not adjustable

I posted in the bug report, not sure how to get someone to read it.  I gave you all the credit.  Thank you!

Offline

Board footer

Powered by FluxBB