diff --git a/bin/omarchy-install-gaming-xbox-controllers b/bin/omarchy-install-gaming-xbox-controllers index be5e97d9..a6fa654b 100755 --- a/bin/omarchy-install-gaming-xbox-controllers +++ b/bin/omarchy-install-gaming-xbox-controllers @@ -6,15 +6,30 @@ set -e # Install xpadneo to ensure controllers work out of the box -omarchy-pkg-add linux-headers -omarchy-pkg-aur-add xpadneo-dkms +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 -# Give user access to game controllers -sudo usermod -a -G input $USER +# 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 -# Modules need to be loaded -gum confirm "Install requires reboot. Ready?" && sudo reboot now +# 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 "Xbox controller Bluetooth support is active. Pair it with Bluetooth using Super + Ctrl + B." diff --git a/bin/omarchy-menu b/bin/omarchy-menu index bbde5c06..c1f95b47 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -386,7 +386,7 @@ show_install_ai_menu() { } show_install_gaming_menu() { - case $(menu "Install" " Steam\n RetroArch\n󰍳 Minecraft\n Battle.net\n󰢹 NVIDIA GeForce NOW\n󰖺 Xbox Controller [AUR]") in + case $(menu "Install" " Steam\n RetroArch\n󰍳 Minecraft\n Battle.net\n󰢹 NVIDIA GeForce NOW\n󰖺 Xbox Controller (󰂯)") in *Steam*) present_terminal omarchy-install-gaming-steam ;; *RetroArch*) present_terminal omarchy-install-gaming-retroarch ;; *Minecraft*) install_and_launch "Minecraft" "minecraft-launcher" "minecraft-launcher" ;;