mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
tools: ratbagc - allow for the device to be just 'event7'
ratbagctl requires 'eventX' as argument, but ratbag-command requires /dev/input/eventX. That's not smart, let's do better. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
@@ -188,6 +188,9 @@ class Ratbagd(object):
|
||||
|
||||
def __getitem__(self, id):
|
||||
"""Returns the requested device, or None."""
|
||||
if id.startswith("event"):
|
||||
id = "/dev/input/{}".format(id)
|
||||
|
||||
if id not in self._devices.keys():
|
||||
try:
|
||||
dev = RatbagdDevice(self._ratbag, id)
|
||||
|
||||
Reference in New Issue
Block a user