2

I've got a Precision 5510 running Ubuntu 16.10 with kernel 4.8.4. In unity, my function keys for brightness work correctly. But xbacklight commands don't do anything. xbacklight -get comes up empty. Is there a way to increase / decrease brightness through the command line? I need this for it to work in i3wm.

1

2 Answers 2

5

You may modify the value in /sys/class/backlight/{may vary}_backlight/brightness

example:

sudo nano /sys/class/backlight/intel_backlight/brightness

This tool does that https://github.com/multiplexd/brightlight then use it like this:

bindsym XF86MonBrightnessUp exec --no-startup-id brightlight -i 20
bindsym XF86MonBrightnessDown exec --no-startup-id brightlight -d 20
2
  • Thanks for the link to "brightlight" :) had some issues with "xbacklight" but brightlight works beautifully (y)! Bound it to my keywoard keys in i3 using brightlight -p -i 10 and brightlight -p -d 10
    – VinceOPS
    Mar 8, 2018 at 22:30
  • Thank you! Been dealing with blinding 100% brightness for over 5 years! Mine was at /sys/class/backlight/psb-bl/brightness for anyone reading this with a Sony Vaio P series. I tried the boot flag and xbackglight without avail, but changing the file worked perfectly.
    – cyanos
    Apr 26, 2018 at 7:12
-1

I am using now i3wm with Ubuntu and i love it. I have a similar problem and i solved this adding this lines in my ~/.config/i3/config file:

# Sreen brightness controls
bindsym XF86MonBrightnessUp exec echo $((`cat /sys/class/backlight/intel_backlight/brightness` + 10)) | sudo tee /sys/class/backlight/intel_backlight/brightness
bindsym XF86MonBrightnessDown exec echo $((`cat /sys/class/backlight/intel_backlight/brightness` - 10)) | sudo tee /sys/class/backlight/intel_backlight/brightnes

and add the /etc/suduers.d/tee file with this:

myuser ALL=(ALL) NOPASSWD: /usr/bin/tee

where myuser is really my user name. My laptop is an HP Spectre x360 with Intel graphics, I know that i need to check the min and max limits but at least in my machine ... no problems ...

2
  • 2
    This seems like a huge security vulnerability. Doesn’t this allow any process to edit any file on the system without requiring a password?
    – Steve
    Apr 28, 2018 at 6:07
  • @Steve looks very dangerous Jun 17, 2018 at 8:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .