Created
May 30, 2020 12:21
-
-
Save gelin/7e74f2edd3d1ed854ecec39c357b0909 to your computer and use it in GitHub Desktop.
Small GUI script to configure some parameters of Wacom pen tablet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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