Skip to content

Instantly share code, notes, and snippets.

@gelin
Created May 30, 2020 12:21
Show Gist options
  • Save gelin/7e74f2edd3d1ed854ecec39c357b0909 to your computer and use it in GitHub Desktop.
Save gelin/7e74f2edd3d1ed854ecec39c357b0909 to your computer and use it in GitHub Desktop.
Small GUI script to configure some parameters of Wacom pen tablet
#!/usr/bin/env python3
from sh import xsetwacom
from easygui import buttonbox
# define for your device
PREFIX = 'Wacom One by Wacom S Pen '
INPUTS = [
'stylus',
'eraser',
]
DEVICES = [PREFIX + input for input in INPUTS]
VERTICAL = '''Вертикально
|
+-o-+
| |
| |
+----+
'''
HORIZONTAL = '''Горизонтально
+--------+
| o--
+--------+
'''
def wacom_set(*params):
for device in DEVICES:
print(xsetwacom.set(device, *params))
choices = [HORIZONTAL, VERTICAL]
reply = buttonbox("Как повернуть планшет?", choices=choices)
if reply == HORIZONTAL:
wacom_set('rotate', 'half')
elif reply == VERTICAL:
wacom_set('rotate', 'ccw')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment