Skip to content

Instantly share code, notes, and snippets.

@antiguru
antiguru / rotate.sh
Last active September 23, 2018 09:24 — forked from h4cc/rotate.sh
Lenovo X220 Tablet rotation script (sets rotation, wacom rotation, subpixel rendering)
#!/bin/bash
# Find the line in "xrandr -q --verbose" output that contains current screen orientation and "strip" out current orientation.
rotation="$(xrandr -q --verbose | grep 'connected' | egrep -o '\) (normal|left|inverted|right) \(' | egrep -o '(normal|left|inverted|right)')"
# Find input devices to be rotated.
IFS=$'\n'
devices=("$(xinput --list --name-only | egrep '(Wacom)|(TrackPoint)')")