Skip to content

Instantly share code, notes, and snippets.

@JuniorJPDJ
Created December 3, 2016 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JuniorJPDJ/0e5115801bdde930f7164363c984ea9d to your computer and use it in GitHub Desktop.
Save JuniorJPDJ/0e5115801bdde930f7164363c984ea9d to your computer and use it in GitHub Desktop.
x220T / other tablet thinkpad rotation scripts
#!/bin/bash
case $(xrandr -q --verbose | grep LVDS1 | awk '{split($0, a); print a[5]}') in
"normal")
rotate="inverted"
wacom="half"
;;
*)
rotate="normal"
wacom="none"
;;
esac
echo "$rotate $wacom"
xrandr --output LVDS1 --rotate "$rotate"
xsetwacom --set "Wacom ISDv4 E6 Finger touch" rotate "$wacom"
xsetwacom --set "Wacom ISDv4 E6 Pen stylus" rotate "$wacom"
xsetwacom --set "Wacom ISDv4 E6 Pen eraser" rotate "$wacom"
#!/bin/bash
case $(xrandr -q --verbose | grep LVDS1 | awk '{split($0, a); print a[5]}') in
"normal")
rotate="left"
wacom="ccw"
;;
"left")
rotate="inverted"
wacom="half"
;;
"inverted")
rotate="right"
wacom="cw"
;;
*)
rotate="normal"
wacom="none"
;;
esac
echo "$rotate $wacom"
xrandr --output LVDS1 --rotate "$rotate"
xsetwacom --set "Wacom ISDv4 E6 Finger touch" rotate "$wacom"
xsetwacom --set "Wacom ISDv4 E6 Pen stylus" rotate "$wacom"
xsetwacom --set "Wacom ISDv4 E6 Pen eraser" rotate "$wacom"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment