I decided to play around with LXDE on a cheap laptop I bought in an employee auction recently (on which I’m running Linux Mint Debian Edition). Everything works great – I forgot how fast and comfortable LXDE is to me, since it’s been quite a while since I used it regularly.
However, the keybindings don’t work for adjusting the screen brightness, and I had to struggle for a bit to figure out how to get them properly mapped to this functionality. Here’s how I did it.
xrandr command was already available, so the first thing I did was run the following in a terminal to see what the display name was on this laptop:
$ xrandr -q | grep connected
For me, on this particular laptop, it resulted in this (and I bolded the part that I was specifically looking for):
LVDS-1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 345mm x 194mm
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
eDP-1 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
VGA-1 disconnected (normal left inverted right x axis y axis)
That gives me the name of the display I need to specify in the
--output portion of the
xrandr command I want to use to adjust the screen brightness.
For me, 50% is just about right on this particular screen, so I tested the command in the terminal with this syntax to set the brightness at half its normal value:
xrandr --output LVDS-1 --brightness 0.5
… and it worked! Muuuuuch better. The backlight on this laptop at 100% is a bit harsh, so this makes it far less piercing.
I put that command into a shell script I put into my home directory, and I created another shell script that does the same thing, except pops the brightness back to 100%, and put that in my home directory as well. Here’s what that one says:
xrandr --output LVDS-1 --brightness 1.0
Map the commands to the keybindings in lxde-rc.xml
Next I went to
~/.config/openbox/lxde-rc.xml and at the end of the
section and added the following to map keys to the shell scripts (link to the actual text here, since the XML isn’t rendering properly in WordPress):
What that does is map the Windows key + the F9 and F10 keys to drop the brightness to 50% and raise it back to 100%, respectively.
Before choosing this combination, I made sure that it wasn’t already in use for anything – I wouldn’t want to create a conflict.
Then, I saved the
lxde-rc.xml file, and from a terminal, I ran the following:
If there’s anything wrong with the syntax of what you added to config, it will pop up an error message here, but if nothing happens, it’s all good.
Then I tested the change by hitting Windows+F9 and Windows+F10 and both worked!
Your mileage may vary based on hardware, but this worked well for me on an HP Elitebook 8540p.