Created
March 12, 2013 12:58
-
-
Save erhan-/5142679 to your computer and use it in GitHub Desktop.
Autorotater for thinkpad x200 tablet under arch linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Working autorotate on thinkpad x200 tablet | |
rstate="0" | |
while [ true ] | |
do | |
react=`grep 0 -c /sys/devices/platform/thinkpad_acpi/hotkey_tablet_mode` | |
if (( ($react == "1") && ($rstate=="1") )); then | |
/usr/bin/xrandr -o normal | |
xsetwacom set "Serial Wacom Tablet WACf008 stylus" Rotate none | |
xsetwacom set "Serial Wacom Tablet WACf008 eraser" Rotate none | |
xsetwacom set "Serial Wacom Tablet WACf008 touch" Rotate none | |
rstate="0" | |
fi | |
if (( ($react != "1") && (rstate == "0") )); then | |
/usr/bin/xrandr -o right | |
xsetwacom set "Serial Wacom Tablet WACf008 stylus" Rotate cw | |
xsetwacom set "Serial Wacom Tablet WACf008 eraser" Rotate cw | |
xsetwacom set "Serial Wacom Tablet WACf008 touch" Rotate cw | |
rstate="1" | |
fi | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment