Browse Source

Add get_xi_id_by_name

pull/2/head
Ali Hatami Tajik 2 years ago
parent
commit
f1237d72e1
  1. 16
      src/scripts/python/util/x.py

16
src/scripts/python/util/x.py

@ -72,6 +72,22 @@ def create_master(name: str = "touch"):
return completed.returncode
def get_xi_id_by_name(name):
"""find device id from name
Args:
name (str): name of the device
"""
completed = subprocess.run(
["xinput list --id-only", name], capture_output=True
)
if completed.returncode == 1:
return -1
else:
int(completed.stdout.decode(ENCODING))
def map_to_output(output, device_id):
# TODO
pass

Loading…
Cancel
Save