From 46d5fae2e5ecad21f15de4e85e93e3b61605b9a4 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 12 Sep 2018 10:52:20 +1000 Subject: [PATCH] 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 --- tools/ratbagc.py.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/ratbagc.py.in b/tools/ratbagc.py.in index 7c26df3a..0f43f458 100644 --- a/tools/ratbagc.py.in +++ b/tools/ratbagc.py.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)