input-remapper icon indicating copy to clipboard operation
input-remapper copied to clipboard

CLI Has Different Devices Listed in Sudo vs User

Open DefsNotQuack opened this issue 2 years ago • 3 comments

When using the CLI control interface and trying to list devices, I get two different lists of devices between super user and my user

As user: user@fedora:~$ input-remapper-control --list-devices Sony Interactive Entertainment DualSense Wireless Controller

As super user: user@fedora:~$ sudo input-remapper-control --list-devices Sony Interactive Entertainment DualSense Wireless Controller Razer Razer Naga Pro Video Bus Logitech USB Receiver Razer Razer Tartarus V2

This means that I am unable to control or begin injections through the CLI without actually being in terminal and issuing it.

I have tried running the underlying service as my user to no avail.

DefsNotQuack avatar Jun 27 '23 14:06 DefsNotQuack

that is right input-remapper-control --list-devices does not communicate with the service, and therefore only has the user permissions. The user does not have permissions to read all devices.


possible solution: The GUI gets around this issue by starting the bin/input-remapper-reader-service as root. The class ReaderClient in in charge of that. It might be possible to modify bin/input-remapper-control to utilize the ReaderClient and do a similar thing. There are a few things that need to be considered:

  • input-remapper-reader-service is a separate process, what happens when both the GUI and the input-remapper-control is running? (possible race-condition?)
  • when the GUI runnig will there be two input-remapper-reader-service processes or one?
  • input-remapper-control --command start also needs to know about the devices
  • since this requires root and we are at the command line, make sure that the password prompt is on the command line and not the GUI?

I will not be working on this for a while. If anyone wants to pick this up I am happy to answer questions.

jonasBoss avatar Jun 27 '23 18:06 jonasBoss

Makes sense, so it is a non-issue really.

Is there a way to allow the user access to more / all devices? What determines which devices the user has access to?

Thanks for your response mate!

DefsNotQuack avatar Jun 28 '23 00:06 DefsNotQuack

maybe this can help: https://bbs.archlinux.org/viewtopic.php?id=273094

jonasBoss avatar Jun 28 '23 08:06 jonasBoss