How do I get the brightness control working on a Lenovo Yoga 13?

Brightness control doesn't work by default in Ubuntu 13.04. Solution for 12.10 doesn't work, also as this

Any idea how to fix it?

Update:

After research I found how to change brightness manually. What need to do is to type in terminal:

echo 2000 | sudo tee /sys/class/backlight/intel_backlight/brightness

It will reduce brightness by half, but still would be good to find solution which will allow to use keyboard for changing brightness.

Update2:

Found solution, see below


Solution 1:

I found solution how to fix problem with brightness

Copy/paste:

  1. Add the acpi_backlight=vendor to your GRUB_DEFAULT command line
  2. Run the sudo update-grub command
  3. blacklist the ideapad_laptop by adding blacklist ideapad_laptop to your /etc/modprobe.d/blacklist.conf file.
  4. Reboot

Solution 2:

I ran into the same problem, the command you wrote will fix it, but in order to get the keys working, I made a little script that watches the /sys/class/backlight/acpi_vide0/brightness file for changes, and then converts and write this to the /sys/class/backlight/intel_backlight/brightness file.

A simple script (that requires inotify-tools):

while inotifywait -e modify /sys/class/backlight/acpi_video0/brightness >/dev/null 2>&1; do
  RATIO=97 #I got this by dividing the intel max_brightness by acpi's max_brightness+1
  BRIGHTNESS=`cat /sys/class/backlight/acpi_video0/brightness`
  NEW_BRIGHTNESS=$((RATIO*BRIGHTNESS))
  echo ${NEW_BRIGHTNESS} > /sys/class/backlight/intel_backlight/brightness
done

Run that as sudo, and you should be golden.

Cheers!

EDIT: Make sure you update the ratio constant, if you can input 2000, our values are different. My intel max is 976.

Solution 3:

If someone still has problems with backlight in yoga on ubuntu 13.04, i wrote a simple python script (you need install python-keybinder with dependencies) based on command from first post.

Need to be run with root privileges. For better usage comfort start it with system or in terminal as independent process (& at the end of run command).

#!/usr/bin/env python
import gtk
import keybinder
import subprocess

# Application need to be run with root privileges

class BrightBinder():

  def __init__(self, act_bright):
    # modes - step can be modify (3rd argument)
    self.levels = range(100, 4880, 700)
    self.levels.append(4880)
    try:
      self.act_bright_index = self.levels.index(int(act_bright))
    except ValueError:
      # can recoginze level - setting maximum
      self.act_bright_index = len(self.levels) - 1
      self.setBright()

  def setBright(self):
    subprocess.call("echo %s > /sys/class/backlight/intel_backlight/brightness" %      str(self.levels[self.act_bright_index]), shell=True)

  def bindKeys(self):
    keybinder.bind(bright_down, self.brightDownCallback, "Keystring %s (user data)" % bright_down)
    keybinder.bind(bright_up, self.brightUpCallback, "Keystring %s (user data)" % bright_up)

  def brightDownCallback(self, user_data):
    if self.act_bright_index > 0:
      self.act_bright_index -= 1
      self.setBright()

  def brightUpCallback(self, user_data):
    if self.act_bright_index < len(self.levels) - 1:
      self.act_bright_index += 1
      self.setBright()

  if __name__ == '__main__':
    bright_down = "XF86MonBrightnessDown"
    bright_up = "XF86MonBrightnessUp"
    # getting actual brightness value
    act_bright = subprocess.check_output(["less", "/sys/class/backlight/intel_backlight/brightness"])
    bright_binder = BrightBinder(act_bright.strip()).bindKeys()
    gtk.main()