2

I freshly installed Lubuntu 18.10 with LXQT environment and here's my issue : I want to dim the backlight of my laptop with the keyboard shortcut (XF86) but when i press it, it changes the brightness(which seems to be a software change because it messes with gamma and contrast)

So i went to the keyboard shortcuts bindings to find the menu that changes what i want :

lxqt-config-brightness menu

^ the slider controls backlight (usual brightness) and the knob messes with contrast..

Here is the shortcut config menu :

lxqt shortcuts

However, there is no way i can find to inc or dec the slider instead of the knob, to have control over backlight. xbacklight and xrandr doesn't work as they output "no output with backlight property" but i can change backlight with echo 700 | sudo tee /sys/class/backlight/intel_backlignt/brightness which sets backlight to 700, but i don't know how to implement inc or dec on a shortcut with this :c

Teach me some unix please :)

  • I guess all this is rather buggy. My shortcuts work as I expect them to, but changes made with the shortcuts are not reflected in the brightness settings, as both the slider and the knob seem unaffected by the shortcut actions. It is as if separate tools overlap here. – user47206 Nov 19 '18 at 10:52
  • Well my shortcut button affects the knob indeed, but not the slider.. – ReSpir3 Nov 20 '18 at 19:53
  • I booted Lubuntu 18.10 on a thumb-drive (I only have it installed on a desktop), and like clpricus, the shortcut keys on my lenovo sl510 only dimmed the brightness (moving only slider, having no impact on 'knob' setting). – guiverc Nov 21 '18 at 5:12
  • I have an acer aspire one cloudbook AO1-431-C89V (ref doesn't matter xD) and is 3 years old, booting lubuntu from ram before installing had the same issue :c – ReSpir3 Nov 30 '18 at 22:38
1

You can add the command lxqt-backlight_backend --dec to the 'shortcut config menu' to decrease the brightness and the command lxqt-backlight_backend --inc to increase it.

However, the commands need root permissions to run. One way to overcome this is to manually change the permissions of /sys/class/backlight/intel_backlight/brightness, but the change isn't permanent, since it will be reset after reboot. If I find a way to make the change permanent I will post it here.

  • oh wow thanks ! this command is much more elegant, i wonder why it required root, where did you find this command exists ? I would like to know if there are more things that i can shortcut – ReSpir3 Nov 30 '18 at 22:50
1

The simplest way I have discovered that doesn't require sudo is to use pkexec lxqt-backlight_backend --inc to increase the backlight brightness and pkexec lxqt-backlight_backend --dec to decrease it.

You can add keyboard shortcuts for these commands in LXQt. I hope this will be fixed soon and it will become the default action for brightness adjustement keyboard combinations instead of the rather useless contrast regulation.

0

Using what you had already discovered worked, I tried on a Lubuntu 18.10 (live) system

echo `cat /sys/class/backlight/intel_backlight/brightness` +180000|bc |sudo tee /sys/class/backlight/intel_backlight/brightness

which would increase my brightness

and

echo `cat /sys/class/backlight/intel_backlight/brightness` -80000|bc |sudo tee /sys/class/backlight/intel_backlight/brightness

which likewise reduced my brightness.

I recommend you work out whatever value you're happy with, and use that (and probably the same for both unlike my testing).

You can then use the 'shortcut config menu' you've already found to create a keyboard shortcut you're happy with for both commands. I didn't try and replace my existing keys, just used a new keystroke that I could live with.

  • ps: this involves no error checking, eventually you'll get negative values if you keep trying to reduce the brightness, or values beyond what your screen can handle. I didn't test the effects of this (nor would my lenovo possibly respond the same as your hardware) – guiverc Nov 21 '18 at 6:08
  • oh wow you nailed it ! I just tested the effects of this and it does not go below 300, just returns "invalid argument". but it required password when i tried it on qterminal – ReSpir3 Nov 30 '18 at 22:48
  • Yeah (re: password) I used sudo so it does require elevated permissions (unless already elevated due to use in prior 5 mins or whatever your threshold is). This wasn't a problem with me as i tested using 'live' and thus didn't notice it as a problem, and I'd not suggest using NOPASSWD.... – guiverc Dec 1 '18 at 2:23
  • I removed the sudo from my command, but also ran sudo chmod a+rw /sys/class/backlight/intel_backlight/brightness that gets written to (in my answer). This worked for me on my tested older version, but alas did not survive reboot. To get around that, I added the chmod a+rw /sys/.. command to a login script (I used ~/.profile) so it gets run on login... It's a hack, and I didn't test on 18.10, but worked on a eeepc that was handy.. – guiverc Dec 1 '18 at 2:35
  • ps: it's I hope obvious; but the command I added to my .profile was chmod a+rw /sys/class/backlight/intel_backlight/brightness (not an abbreviated version I typed before). Also I'd suggest checking for typos, thjs is typed into a 19.04 desktop & not the eeepc I tested with.. – guiverc Dec 1 '18 at 2:51
0

I had the same issue for a very long time, but I finally solved it! I was searching for a solution when I found this: https://help.ubuntu.com/community/Lubuntu/Keyboard#Keyboard_shortcuts . And it says:

Control+F10

Laptop screen dim

Control+F11

Laptop screen brighten

I was curious about this shortcut key, because I used a different one to change my brightness. And as soon as I tried, an error popped up saying that xbacklight could not be found. This leaded me to the solution of our problem:

First, I installed xbacklight with the command sudo apt-get install xbacklight. Only this should've worked for me, but my xbacklight was always returning the following error when executed through the terminal:

No outputs have backlight property

So I googled it and found a solution: https://askubuntu.com/a/1060843 This answer solved the error for me. With xbacklight working, I just created shortcut keys for the following commands:

To increase brightness (-time 0 is optional, just for it to change instantly):

xbacklight -inc 10 -time 0

To decrease brightness (-time 0 is optional, just for it to change instantly):

xbacklight -dec 10 -time 0

This is incredibly practical as it doesn't require root to work, so it will work as soon as you add these shortcuts and will last forever (no sudo after reboot for it to work again :D ).

To summarize:

  1. Install xbacklight with sudo apt-get install xbacklight
  2. Add the following command to your favourite shortcut keys to increase brightness:

    xbacklight -inc 10 -time 0

  3. Add the following command to your favourite shortcut keys to decrease brightness:

    xbacklight -dec 10 -time 0

  4. If the commands don't work, this might be the solution: https://askubuntu.com/a/1060843

References:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.