diff --git a/bin/omarchy-install-controllers b/bin/omarchy-install-controllers new file mode 100755 index 00000000..c61fded6 --- /dev/null +++ b/bin/omarchy-install-controllers @@ -0,0 +1,30 @@ +#!/bin/bash + +# Install support for using Xbox and PlayStation controllers with Steam/RetroArch/etc. + +set -e + +# Xbox: Install xpadneo for improved Xbox controller support +omarchy-pkg-add linux-headers +omarchy-pkg-aur-add xpadneo-dkms + +# Xbox: 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 + +# PlayStation: Ensure hid-playstation module loads at boot +echo hid_playstation | sudo tee /etc/modules-load.d/hid-playstation.conf >/dev/null + +# PlayStation: Enable userspace HID for Bluetooth controller support +if [ -f /etc/bluetooth/input.conf ]; then + grep -q "UserspaceHID=true" /etc/bluetooth/input.conf || \ + sudo sed -i '/^\[General\]/a UserspaceHID=true' /etc/bluetooth/input.conf +else + printf '[General]\nUserspaceHID=true\n' | sudo tee /etc/bluetooth/input.conf >/dev/null +fi + +# Give user access to game controllers +sudo usermod -a -G input $USER + +# Modules need to be loaded +gum confirm "Install requires reboot. Ready?" && sudo reboot now diff --git a/bin/omarchy-install-steam b/bin/omarchy-install-steam index 2d3b7cd9..b2dd0dc7 100755 --- a/bin/omarchy-install-steam +++ b/bin/omarchy-install-steam @@ -1,9 +1,17 @@ #!/bin/bash -# Install and launch Steam after first letting the user pick the correct grahics card drivers. +# Install Steam with gaming essentials (Gamescope, GameMode, MangoHud) and launch. set -e +omarchy-pkg-add gamescope gamemode lib32-gamemode mangohud lib32-mangohud + echo "Now pick dependencies matching your graphics card" sudo pacman -S steam -setsid gtk-launch steam >/dev/null 2>&1 & + +# Override Steam's .desktop to launch inside Gamescope +mkdir -p ~/.local/share/applications +sed 's|Exec=/usr/bin/steam|Exec=gamescope -e -- steam|' \ + /usr/share/applications/steam.desktop > ~/.local/share/applications/steam.desktop + +setsid gamescope -e -- steam >/dev/null 2>&1 & diff --git a/bin/omarchy-install-xbox-controllers b/bin/omarchy-install-xbox-controllers deleted file mode 100755 index c192e282..00000000 --- a/bin/omarchy-install-xbox-controllers +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -# Install support for using Xbox controllers with Steam/RetroArch/etc. - -set -e - -# Install xpadneo to ensure controllers work out of the box -omarchy-pkg-add linux-headers -omarchy-pkg-aur-add 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 - -# Modules need to be loaded -gum confirm "Install requires reboot. Ready?" && sudo reboot now diff --git a/bin/omarchy-menu b/bin/omarchy-menu index 05256313..94fcbabd 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -365,12 +365,12 @@ show_install_ai_menu() { } show_install_gaming_menu() { - case $(menu "Install" " Steam\n󰢹 NVIDIA GeForce NOW\n RetroArch [AUR]\n󰍳 Minecraft\n󰖺 Xbox Controller [AUR]") in + case $(menu "Install" " Steam + Gamescope\n󰢹 NVIDIA GeForce NOW\n RetroArch [AUR]\n󰍳 Minecraft\n󰖺 Xbox + PS Controllers [AUR]") in *Steam*) present_terminal omarchy-install-steam ;; *GeForce*) present_terminal omarchy-install-geforce-now ;; *RetroArch*) aur_install_and_launch "RetroArch" "retroarch retroarch-assets libretro libretro-fbneo" "com.libretro.RetroArch.desktop" ;; *Minecraft*) install_and_launch "Minecraft" "minecraft-launcher" "minecraft-launcher" ;; - *Xbox*) present_terminal omarchy-install-xbox-controllers ;; + *Controllers*) present_terminal omarchy-install-controllers ;; *) show_install_menu ;; esac }