Ubuntu with tablet mode for Lenovo Yoga

Note: This answer is old. With 18.04 this is irrelevant. Works "out of the box"

Ill add how to get the touch keyboard as soon as I have time. But as a surfing pad this is fine.

I just bought this ((Lenovo yoga 710 (I7)) and had some issues, here's what I found.

Update your BIOS (The fan appreciates it! trust me) Some might need a special BIOS: https://forums.lenovo.com/t5/Lenovo-Yoga-Series-Notebooks/Yoga-900-and-Ideapad-710S-Linux-Only-BIOS/ta-p/3466850

I used the normal one from late 2016 (Or newer)

If you have boot problems:

Dont disable ACPI"

Linux will boot if you add the kernel parameter: modprobe.blacklist=hid_sensor_hub If you are happy without the gyroscope, just add this to your kernel parameters in /etc/default/grub: "modprobe.blacklist=hid_sensor_hub quiet splash"

Or press E when you are at the first boot menu for install and do the same. Exit and start with Ctrl-X

If however you want the Gyroscope to work, you need to do some extra work. I am currently running Ubuntu 16.04 with this configuration (I imagine this would work independent on your distro with some minor mods to suit the distro):

You need to get a kernel newer than 4.10rc4 from the Ubuntu mainline You no longer need to pass the kernel parameter. Adds a couple of seconds boot time but with flip flop screen who cares

After you installed the kernel you need something that can monitor your sensor

This project is already in the Ubuntu repos:

sudo apt install iio-sensor-proxy inotify-tools

NB: You might have to put your computer to sleep and wake it up for the sensor to work. After that it keeps working.

Then if you are running Gnome 3.18 or newer, you should be good to go. Gnome should detect your tilt and move accordingly.

If you are running unity you need to add a script. Follow the guide here with one exeption. Use my modified script as the original flips the screen wrong.

Modified:

#!/bin/sh
# Auto rotate screen based on device orientation

# Receives input from monitor-sensor (part of iio-sensor-proxy package)
# Screen orientation and launcher location is set based upon accelerometer position
# Launcher will be on the left in a landscape orientation and on the bottom in a portrait orientation
# This script should be added to startup applications for the user

# Clear sensor.log so it doesn't get too long over time
> sensor.log

# Launch monitor-sensor and store the output in a variable that can be parsed by the rest of the script
monitor-sensor >> sensor.log 2>&1 &

# Parse output or monitor sensor to get the new orientation whenever the log file is updated
# Possibles are: normal, bottom-up, right-up, left-up
# Light data will be ignored
while inotifywait -e modify sensor.log; do
# Read the last line that was added to the file and get the orientation
ORIENTATION=$(tail -n 1 sensor.log | grep 'orientation' | grep -oE '[^ ]+$')

# Set the actions to be taken for each possible orientation
case "$ORIENTATION" in
normal)
xrandr --output eDP1 --rotate right && gsettings set com.canonical.Unity.Launcher launcher-position Bottom ;;
bottom-up)
xrandr --output eDP1 --rotate left && gsettings set com.canonical.Unity.Launcher launcher-position Bottom ;;
right-up)
xrandr --output eDP1 --rotate normal && gsettings set com.canonical.Unity.Launcher launcher-position Left ;;
left-up)
xrandr --output eDP1 --rotate inverted && gsettings set com.canonical.Unity.Launcher launcher-position Left ;;
esac
done