Hi All,
I don’t know if many people use LXDE but I happen to use it on a netbook with 2gB RAM and it works brilliantly. I had to get a few things sorted out after install. These were things like automatically showing the last user name at the login prompt, setting DNS on the WIFI etc. The most annoying one was, LXDE did not have a screen brightness adjustment option nor did the hot keys for it work. To add to my frustration, xbacklight couldn’t fix it either. After a lot of research, I found a way to allow screen brightness adjustments:
- The screen brightness is controlled via a number in the file: “/sys/class/backlight/<folder name, e.g. intel_backlight/brightness”. But the default permissions won’t allow to write to it without sudo. This means even if you set a keyboard shortcut to set this number, it won’t work.
- To add write + execution permission, I did
sudo chmod -c -v a+x+w /sys/class/backlight/intel_backlight/brightness
. Note: the -c-v flag is to show verbose.
- The next step was to formulate a bash script which I could assign to my brightness control keys. I wanted an elegant solution, I.e. not having two bash script files (one for increasing brightness, decreasing etc.) that needs to be called all the time. This is how I achieved it.
- First set up a hotkey for increasing the brightness (choose any combination) in the lxhotkey window as an execute-command option. Then add this command
bash -c "while read name; do bash \-c \"echo \$((name+100)) > /sys/class/backlight/intel_backlight/brightness\";done < \"/sys/class/backlight/intel_backlight/brightness\""
. Note your folder may differ from intel_backlight and depending on your laptop, your brightness might run from 0-8 but mine goes from 0-2400, hence I increase the brightness at a step of 100 (see $name+100). You need to chose your preference here.
- Similarily, repeat step 4 but this time choose your decrease brightness keys and add the same script with the following change:
$((name-100))
I think this makes sense, it took me a while to figure this out and the internet eventually proved helpful so I hope this helps you save time/frustration.
Reference:
1.https://robertgrantstats.wordpress.com/2015/03/03/adjust-brightness-in-lxde-linux/
2.https://stackoverflow.com/questions/10929453/read-a-file-line-by-line-assigning-the-value-to-a-variable
3.https://help.ubuntu.com/community/FilePermissions