Skip to content

Instantly share code, notes, and snippets.

View pavel-kirienko's full-sized avatar
:shipit:

Pavel Kirienko pavel-kirienko

:shipit:
View GitHub Profile
@pavel-kirienko
pavel-kirienko / 51-xbox-gamepad.rules
Last active June 30, 2024 18:08 — forked from dnmodder/fixcontroller.py
Use Microsoft X-Box 360 Gamepad with GNU/Linux
# By default, X-Box 360-compatible controllers are detectable but dysfunctional because they expect the host
# to send a particular USB control transfer with some sort of initialization command.
# This udev rule will invoke a trivial Python script automatically when the gamepad is connected that emits
# the required initialization command.
#
# Integration:
# 1. Put this rule into /etc/udev/rules.d/51-xbox-gamepad.rules
# 2. Install pyusb for the root's Python: sudo pip install pyusb
# 3. Reload udev rules as root: udevadm control --reload-rules && udevadm trigger
#