summaryrefslogtreecommitdiff
path: root/autorotate.c
diff options
context:
space:
mode:
authorJakob Kaivo <jakob@kaivo.net>2016-10-01 16:01:37 -0400
committerJakob Kaivo <jakob@kaivo.net>2016-10-01 16:01:37 -0400
commitaeadaa4c4549808d16609ffeee993dce9b05ff77 (patch)
tree922b1e85e9c8a4d15f04822c91f3ddfd35d85bfc /autorotate.c
parentd896a8b2524836dfa1225c052fe692e1276091dd (diff)
add hacky xsetwacom to rotate stylus input
Diffstat (limited to 'autorotate.c')
-rw-r--r--autorotate.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/autorotate.c b/autorotate.c
index 0a7b403..d1864c1 100644
--- a/autorotate.c
+++ b/autorotate.c
@@ -57,6 +57,14 @@ void rotatetouch(enum rotation r)
system(cmd);
}
+void rotatewacom(enum rotation r)
+{
+ char *rotations[] = { "none", "half", "ccw", "cw" };
+ char cmd[512];
+ sprintf(cmd, "for dev in $(xsetwacom --list devices | cut -b 38-40); do xsetwacom set \"$dev\" rotate %s; done", rotations[r]);
+ system(cmd);
+}
+
enum rotation setrotation(enum rotation r)
{
static enum rotation prev = NORMAL;
@@ -65,8 +73,10 @@ enum rotation setrotation(enum rotation r)
}
rotatescreen(r);
+ /* Allow xinput to relocate devices */
sleep(1);
rotatetouch(r);
+ rotatewacom(r);
prev = r;
return r;