Giter Club home page Giter Club logo

thinkpad_x1_yoga_rotation's Introduction

Warning
since I moved to Ubuntu 17.10 with Wayland and Gnome I don’t actively develop this script any longer since the desired functionality seem to work out of the box.

auto screen rotation on a Thinkpad X1 Yoga

The Thinkpad X1 Yoga is a convertible laptop, so you can flip the screen over and your laptop is now a tablet. Tablets are typically used in different orientations. To detect orientation it is supplied with a BMA 150 accelerometer.

Since version 4.9-rc2 linux kernel contains patches for this device so it works nicely with iio-sensor-proxy. It seems that Kernel 4.10 has an issue with this which was resolved in Kernel 4.11.

This project provides a script dealing with automatic screen rotation and some other tablet/laptop convenience features.

So far, I’ve tested it with Ubuntu 17.04 and appreciate any feedback.

prerequisites

  • Linux kernel 4.9-rc2 or >= 4.11

  • linux packages python3, python3-dbus, python3-gi, onboard, iio-sensor-proxy

installation and usage

This python script thinkpad_x1_yoga_rotation.py provides the following features:

  • Listen to dbus signals from sensor proxy and check if display orientation has changed. In case of a change event the display is rotated approriately using xrandr. The X1 Yoga has 3 wacom devices: finger touch, pen stylus and pen eraser. For all of them rotation is adoption appriately.

  • When the laptop is converted to tablet mode touchpad and trackpoint are switched off and a onboard keyboard is started. When going back to laptop mode the orginal state is restored.

  • disable finger touch if stylus is close to the display

  • upon termination, restore "normal" screen orientation, switch on touchpad and trackpoint

usage

./thinkpad_x1_yoga_rotation.py

Now rotate your display by 90 degrees and screen orientation should follow.

setup autostart

On Ubuntu open "Startup Applications" ("Startprogramme" in German) and add a startup application using the full path to thinkpad_x1_yoga_rotation.py.

thinkpad_x1_yoga_rotation's People

Contributors

sarmbruster avatar galou avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.