Wednesday, June 17, 2015

How to make back-light Brightness Fn keys work on LXDE.

Back-light Brightness is set on my Laptop by Fn+F11 (down) and Fn+F12 (up) keys. These keys worked on Ubuntu Unity Desktop but not on LXDE Desktop.

I tried xbacklight command but it did not work. Then after googling I discovered that xbacklight does not work on radeon driver.

Then I tried how it works on Ubuntu Unity Desktop and found that following command was executed by USER=root
/usr/lib/unity-settings-daemon/usd-backlight-helper --set-brightness 24
Since the command to be executed required root privileges I created two bash shell files on my desktop:File ~/home/Desktop/Brightness1
#! /bin/bash
# script to set the initial brightness on login
[ "$UID" -eq 0 ] || exec gksu bash "$0" "$@"
/usr/lib/unity-settings-daemon/usd-backlight-helper --set-brightness 12
File ~/home/Desktop/Brightness2
#! /bin/bash
# script to set the initial brightness on login
[ "$UID" -eq 0 ] || exec gksu bash "$0" "$@"
/usr/lib/unity-settings-daemon/usd-backlight-helper --set-brightness 24
I made the files executable and tested them. The script asked for sudo password and set the required brightness.
Then I inserted following Keycodes in ~/.config/openbox/rc.xml
<!-- Keybindings for LCD Backlight -->    <keybind key="XF86MonBrightnessDown">        # decrease screen brightness      <action name="Execute"><command>/home/user/Desktop/Brightness1</command></action>    </keybind>    <keybind key="XF86MonBrightnessUp">        # increase screen brightness      <action name="Execute"><command>/home/user/Desktop/Brightness2</command></action>    </keybind>
and it works by pressing Fn+F11 and Fn+F12 i.e. it asks for sudo password and sets the required brightness. 

No comments:

Air India direct flight to San Fransisco has flown through China today.

 My sister in law left for San Fransisco by AI 173 flight which flows over North Pole. I tracked that flight on flightstats.com till it land...