Browse Source

Fix create-master system error

pull/2/head
Ali Hatami Tajik 2 years ago
parent
commit
730cc2325f
  1. 5
      src/scripts/python/util/pointer.py
  2. 8
      src/scripts/python/util/x.py

5
src/scripts/python/util/pointer.py

@ -1,5 +1,4 @@
import x as xutil
import re
import util.x as xutil
from enum import Enum
@ -43,7 +42,7 @@ class Pointer(XInput):
super().__init__(name, id, state)
def __repr__(self) -> str:
return f"<Pointer: {self.name}-{self.id}-{self.state}"
return f"<Pointer: {self.name}-{self.id}-{self.state}>"
@property
def slave(self):

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

@ -67,7 +67,7 @@ def create_master(name: str = "touch"):
Args:
name (str, optional): name of the master. Defaults to 'touch'.
"""
completed = subprocess.run(["xinput create-master", name])
completed = subprocess.run(["xinput", "create-master", name])
return completed.returncode
@ -79,13 +79,13 @@ def get_xi_id_by_name(name):
name (str): name of the device
"""
completed = subprocess.run(
["xinput list --id-only", name], capture_output=True
["xinput", "list", "--id-only", name], capture_output=True
)
if completed.returncode == 1:
return -1
return None
else:
int(completed.stdout.decode(ENCODING))
return int(completed.stdout.decode(ENCODING))
def map_to_output(output, device_id):

Loading…
Cancel
Save