# Using Xbox Controller on Archlinux


## Xbox Controller Connection Guide on Arch Linux

On Arch Linux, there are three main ways to connect an Xbox controller. **Please choose the driver solution corresponding to your connection method:**

| Connection Method    | Recommended Driver | Scope / Compatibility                                  |
| :------------------- | :----------------- | :----------------------------------------------------- |
| **USB Wired**        | `xpad`             | Built into the kernel; plug-and-play.                  |
| **Bluetooth**        | `xpadneo`          | Xbox One S / Series X\|S / Elite 2.                    |
| **Wireless Adapter** | `xone`             | Official Microsoft Xbox Wireless Adapter (USB dongle). |

## 1. USB Wired Connection

The wired mode is the most straightforward. The Arch official kernel includes the `xpad` module by default, and it usually works out of the box.

**Troubleshooting Steps:**

1.  **Check if the driver exists:**
    ```bash
    modinfo xpad
    ```
    If detailed information is displayed, the driver is present. If not, check if you are using a stripped-down/minimal kernel.
2.  **Check if the driver is loaded:**
    ```bash
    lsmod | grep '^xpad\b'
    ```
    If there is no output, load the driver manually:
    ```bash
    sudo modprobe xpad
    ```
3.  **Check if it is disabled:**
    If it stops working after a reboot, check the configuration files:
    - `/etc/modprobe.d/*.conf`
    - `/usr/lib/modprobe.d/*.conf`
      If you find `blacklist xpad`, comment it out (add a `#` at the beginning of the line), then reload the driver.

    _Note: If you have `xone` installed, it is normal for `xpad` to be blacklisted/disabled; you do not need to re-enable it._

## 2. Bluetooth Connection

For Bluetooth connections, the `xpadneo` driver is recommended. Compared to the default kernel solution, it provides better support for battery level reporting, rumble feedback, and button mapping.

**Supported Models:** Xbox One S, Xbox Series X|S, and some Elite Series 2 models.

**Installation Steps:**

1.  **Install Dependencies**: Ensure you have the headers for your current kernel installed (e.g., `linux-headers`).
2.  **Install the Driver**:
    ```bash
    yay -S xpadneo-dkms  # Or use your preferred AUR helper
    ```
3.  **Restart Bluetooth Service**:
    ```bash
    sudo systemctl restart bluetooth.service
    ```
4.  **Pairing**: Put the controller into pairing mode and complete the connection via your desktop environment's settings or `bluetoothctl`.

**Common Issues:**
If you experience **pairing failures, immediate disconnections, or frequent reconnecting**, it is usually caused by outdated controller firmware. It is recommended to update the firmware using the `Xbox Accessories` app on a Windows system.

## 3. Wireless Adapter Connection

If you are using the official Microsoft Xbox Wireless Adapter (USB dongle), you should use the `xone` driver.

> **Note**: `xone` will take over the device and disable `xpad` to prevent driver conflicts. It supports both the wireless adapter and wired connections.

**Installation Steps:**

1.  **Install Dependencies**: Ensure the headers for your current kernel are installed.
2.  **Install Driver and Firmware**:
    ```bash
    yay -S xone-dkms xone-dongle-firmware
    ```
3.  **Reboot**: According to the ArchWiki, a reboot is required after installation to correctly load the firmware and take over the device.

After rebooting, simply plug in the adapter to connect. If you experience latency or abnormal behavior, try updating the controller firmware first.

## References

- **ArchWiki**: [Gamepad - Xbox Wireless Controller](https://wiki.archlinux.org/title/Gamepad#Xbox_Wireless_Controller_/_Xbox_One_Wireless_Controller)
- **xpadneo (Bluetooth)**: [GitHub](https://github.com/atar-axis/xpadneo)
- **xone (Adapter)**: [GitHub](https://github.com/dlundqvist/xone)


---

> Author: Nite  
> URL: https://www.nite07.com/en/posts/linux-xbox-controller/  

