From f59ab31d549c17ab379a1a328b0824d8c4d6e46d Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sun, 27 Nov 2022 18:00:56 +0100 Subject: [PATCH] tabletcfg: Make huion-tablet more generic --- huion-tablet.py => tabletcfg.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename huion-tablet.py => tabletcfg.py (74%) diff --git a/huion-tablet.py b/tabletcfg.py similarity index 74% rename from huion-tablet.py rename to tabletcfg.py index baa90a1..bc976a4 100755 --- a/huion-tablet.py +++ b/tabletcfg.py @@ -1,11 +1,11 @@ #!/usr/bin/env cached-nix-shell #!nix-shell -i python3 -p "python3.withPackages(ps: [ ps.pyyaml ])" -# Set Huion H430P parameters from saved profiles using swaymsg +# Set Digitizer parameters from saved profiles using swaymsg # # This currently only works for setting the screen and area but not for setting # the buttons. # -# Write your config into ~/.config/huion-tablet.yml +# Write your config into ~/.config/tabletcfg.yml # Example: # # presets: @@ -13,7 +13,7 @@ # screen: DP-4 # area: 0 0 1 1 # -# then run huion-tablet.py my-preset +# then run tabletcfg.py my-preset from subprocess import run import os.path import sys @@ -23,7 +23,7 @@ import yaml def _set_parameter(parameter, *args): args = map(str, args) run( - ["swaymsg", "input", "9580:109:HUION_Huion_Tablet_Pen", parameter, *args], + ["swaymsg", "input", "type:tablet_tool", parameter, *args], check=True, ) @@ -38,7 +38,7 @@ def map_from_region(x1, y1, x2, y2): preset = sys.argv[1] -with open(os.path.expanduser("~/.config/huion-tablet.yml"), "r") as f: +with open(os.path.expanduser("~/.config/tabletcfg.yml"), "r") as f: config = yaml.load(f, Loader=yaml.SafeLoader) preset = config["presets"][preset]