Skip to content

Commit

Permalink
If the tablet is not mapped to any monitor, print a comment
Browse files Browse the repository at this point in the history
Makes the output easier to understand since empty strings look more like
a bug than a "not mapped" setting. Output is now something like:

        settings:
          area: [0.0, 0.0, 0.0, 0.0]
          keep-aspect: true
          left-handed: false
          mapping: 'absolute'
          output: ['', '', '']  # not mapped to any monitor
  • Loading branch information
whot committed Oct 28, 2024
1 parent cbeeca5 commit 34a8925
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ devices:
keep-aspect: false
left-handed: false
mapping: 'absolute'
output: ['', '', '']
output: ['', '', ''] # not mapped to any monitor
- name: "Wacom Intuos Pro M Pen"
usbid: "056A:0357"
settings:
Expand Down
7 changes: 6 additions & 1 deletion src/gsetwacom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ def print_tablet_settings(settings, indent=0):
keys = ("area", "keep-aspect", "left-handed", "mapping", "output")
click.echo(f"{indent}settings:")
for key in filter(lambda k: settings.has_key(k), keys):
click.echo(f"{indent} {key}: {settings.get_value(key)}")
value = settings.get_value(key)
comment = ""
if key == "output":
if all(not v for v in value):
comment = " # not mapped to any monitor"
click.echo(f"{indent} {key}: {value}{comment}")


def print_stylus_settings(settings, indent=0):
Expand Down

0 comments on commit 34a8925

Please sign in to comment.