Lenovo ThinkPad X1 Yoga OLED Brightness

I'm running 16.04 on my X1 Yoga OLED.

I can't change the brightness of the screen at all, it seems to be on maximum brightness all the time. I've tried:

  • Fn+F5/F6
  • xbacklight -set 50(and 100, and 0, and 20, ...)/xbacklight -dec 10

I'm using GNOME Shell in Xorg.

Hopefully useful list of software and versions, tell me in the comments if you need more.

gnome-shell 3.18.5-0ubuntu0.1
tlp         0.9-1~xenial
tp-smapi    0.41-1

Solution 1:

There is no backlight with an OLED screen. So the normal methods do not work. Adjust screen brightness by way of:

xrandr --output eDP1 --brightness .5  # dim to half 

xrandr --output eDP1 --brightness 1  # no dimming

the number can be anything between 0 and 1

Solution 2:

I've been looking for a way to run the xrandr command when pressing the brightness buttons. I created custom acpi events for that (more info on that here: https://help.ubuntu.com/community/LaptopSpecialKeys ). This is still a hack and no proper solution, but it works for me:

I created three files, /etc/acpi/events/yoga-brightness-up:

event=video/brightnessup BRTUP 00000086
action=/etc/acpi/yoga-brightness.sh up

and /etc/acpi/events/yoga-brightness-down:

event=video/brightnessdown BRTDN 00000087
action=/etc/acpi/yoga-brightness.sh down

and finally /etc/acpi/yoga-brightness.sh:

#!/bin/sh

# Where the backlight brightness is stored
BR_DIR="/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/"


test -d "$BR_DIR" || exit 0

MIN=0
MAX=$(cat "$BR_DIR/max_brightness")
VAL=$(cat "$BR_DIR/brightness")

if [ "$1" = down ]; then
    VAL=$((VAL-71))
else
    VAL=$((VAL+71))
fi

if [ "$VAL" -lt $MIN ]; then
    VAL=$MIN
elif [ "$VAL" -gt $MAX ]; then
    VAL=$MAX
fi

PERCENT=`echo "$VAL / $MAX" | bc -l`

export XAUTHORITY=/home/ivo/.Xauthority  # CHANGE "ivo" TO YOUR USER
export DISPLAY=:0.0

echo "xrandr --output eDP-1 --brightness $PERCENT" > /tmp/yoga-brightness.log
xrandr --output eDP-1 --brightness $PERCENT

echo $VAL > "$BR_DIR/brightness"

which is heavily inspired by the file asus-keyboard-backlight.sh and the information on https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/660901 for the xrandr root-access problem.

Don't forget to restart acpi by typing

sudo service acpid reload

I hope, this helps ;-)