diff options
author | Jakob Kaivo <jakob@kaivo.net> | 2016-10-01 16:01:37 -0400 |
---|---|---|
committer | Jakob Kaivo <jakob@kaivo.net> | 2016-10-01 16:01:37 -0400 |
commit | aeadaa4c4549808d16609ffeee993dce9b05ff77 (patch) | |
tree | 922b1e85e9c8a4d15f04822c91f3ddfd35d85bfc | |
parent | d896a8b2524836dfa1225c052fe692e1276091dd (diff) |
add hacky xsetwacom to rotate stylus input
-rw-r--r-- | autorotate.c | 10 |
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; |