From aeadaa4c4549808d16609ffeee993dce9b05ff77 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sat, 1 Oct 2016 16:01:37 -0400 Subject: add hacky xsetwacom to rotate stylus input --- autorotate.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; -- cgit v1.2.1