/ de-omarchy / bin / omarchy-install-gaming-xbox-controllers
swadhinbiswas Initial de-omarchy: Omarchy UI layer for Arch-based distros · 8/22/2026
9f393b2
40 lines · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash

# omarchy:summary=Install support for using Xbox controllers with Steam/RetroArch/etc.
# omarchy:group=install
# omarchy:name=gaming xbox-controllers
# omarchy:requires-sudo=true

set -e

echo "Installing Xbox controller Bluetooth support..."

# Install xpadneo to ensure controllers work out of the box
omarchy-pkg-add linux-headers xpadneo-dkms

# Prevent xpad/xpadneo driver conflict
echo blacklist xpad | sudo tee /etc/modprobe.d/blacklist-xpad.conf >/dev/null
echo hid_xpadneo | sudo tee /etc/modules-load.d/xpadneo.conf >/dev/null

# Ensure user is in the input group (controllers need it)
needs_reboot=false
if ! id -nG "$USER" | grep -qw input; then
  sudo usermod -aG input "$USER"
  needs_reboot=true
fi

# Swap drivers in the running kernel so a reboot isn't needed otherwise
if lsmod | grep -q '^xpad '; then
  sudo modprobe -r xpad 2>/dev/null || needs_reboot=true
fi

if $needs_reboot; then
  gum confirm "Reboot needed to finish setup. Reboot now?" && sudo reboot now
  exit 0
fi

sudo modprobe hid_xpadneo

echo ""
echo "Now you can pair your Xbox controller with Bluetooth using Super + Ctrl + B."