Xboxdrv udev and controller scripts
parasven last edited by parasven
I have created some scripts to automate starting xboxdrv via udev and systemd services. Maybe someone has a use for them.
Currently there ist configuration for the following controllers:
- Xbox One Wireless Controller
- Nintendo Switch Pro Controller
- 8Bitdo SFC30 Controller
Excerpt from Github Describtion:
I wanted to have a reliable way to start and stop xboxdrv when a controller gets connected.
Using xboxdrv also makes it easier to have the same controls accross different emulators and controllers.
What does it do?
Once a Controller gets connected to the system the corresponding udev rules will do several things with it:
Change the file permissions of the original /dev/input/eventX and /dev/input/jsX device files to 0600.
This is done to prevent emulators and emulationstation from listing controllers that are occupied by the xboxdrv when started as normal user.
xboxdrv creates new event and js device files anyway.
Afterwards a systemd service is started, which launches the xboxdrv script for the controller that has been connected.
The launched xboxdrv-script should have all the need configurations for the controller to work properly
- When the controller is removed or disconnected the systemd service will be stopped.
This will kill the corresponding xboxdrv for the controller.
You can get in here:
- Added configs for the Xbox 360 Wireless Receiver. The Button map for xboxdrv was created with xpad option trigger as buttons disabled.
- Altered the uninstall script to directly delete the symlinks without using find command. To avoid deleting other files by accident.