From 3afa3b6ecc4be7ae349ce0974652f894e7389a34 Mon Sep 17 00:00:00 2001 From: wassname Date: Thu, 27 Dec 2018 12:08:24 +0800 Subject: [PATCH] rotate pens true and prints --- rotate/thinkpad-rotate.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/rotate/thinkpad-rotate.py b/rotate/thinkpad-rotate.py index c852f81..0ac9100 100755 --- a/rotate/thinkpad-rotate.py +++ b/rotate/thinkpad-rotate.py @@ -23,7 +23,7 @@ https://gist.githubusercontent.com/ei-grad/4d9d23b1463a99d24a8d/raw/rotate.py ### BEGIN Configurables -rotate_pens = False # Set false if your DE rotates pen for you +rotate_pens = True # Set false if your DE rotates pen for you disable_touchpads = False # Don't use in conjunction with tablet-mode ### END Configurables @@ -82,20 +82,30 @@ STATES = [ def rotate(state): s = STATES[state] - check_call(['xrandr', '-o', s['rot']],env=env) + + cmd=['xrandr', '-o', s['rot']] + print(cmd) + check_call(cmd,env=env) + for dev in touchscreens if disable_touchpads else (touchscreens + touchpads): - check_call([ + cmd =[ 'xinput', 'set-prop', dev, 'Coordinate Transformation Matrix', - ] + s['coord'].split(),env=env) + ] + s['coord'].split() + print(cmd) + check_call(cmd,env=env) if rotate_pens: for dev in wacoms: - check_call([ + cmd=[ 'xsetwacom','set', dev, - 'rotate',s['pen']],env=env) + 'rotate',s['pen']] + print(cmd) + check_call(cmd,env=env) if disable_touchpads: for dev in touchpads: - check_call(['xinput', s['touchpad'], dev],env=env) + cmd = ['xinput', s['touchpad'], dev] + print(cmd) + check_call(cmd,env=env) def read_accel(fp): fp.seek(0)