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.

ashic
  • 383

2 Answers2

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
unil
  • 96
  • 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 08 '18 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 '18 at 07: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 ...

Yonsy Solis
  • 862
  • 2
  • 8
  • 20