steam-deck-utilities icon indicating copy to clipboard operation
steam-deck-utilities copied to clipboard

Add tool to install xone

Open genna87 opened this issue 2 years ago • 8 comments

When playing docked I like to use my Xbox controllers with an Xbox Wireless Adapter. To do so I use a driver called xone.

It provides a better and more stable connection than BlueTooth and I don't have to struggle with pairing every time.

But every SteamOS update wipes it out so I need to reinstall it. Having a built-in installer here would be really helpful.

This is the script I'm using. There is definitely a lot of room for improvement.

#!/bin/bash

# references
# https://github.com/medusalix/xone
# https://discord.com/channels/733964971842732042/819644054563192846
# https://gist.github.com/cdleveille/e84c235c6e8c17042d35a7c0d92cdc96
# https://www.reddit.com/r/SteamDeck/comments/yr248o/install_guide_for_xbox_controller_dongle_firmware

# set xone local repo folder location
XONE_LOCAL_REPO="/home/deck/xone"

# disable read-only filesystem
sudo steamos-readonly disable

# install required packages
sudo pacman-key --init && sudo pacman-key --populate archlinux
sudo pacman -Syu curl wget git base-devel gcc cabextract linux-neptune-headers dkms libisl libmpc

# rename/back up fakeroot.conf to avoid error
sudo mv /etc/ld.so.conf.d/fakeroot.conf /etc/ld.so.conf.d/fakeroot.conf.bck

# does the xone local repo folder already exist?
if [ ! -d $XONE_LOCAL_REPO ]
then
    # ...if no, clone the repo and cd into it
    git clone https://github.com/medusalix/xone $XONE_LOCAL_REPO
    cd $XONE_LOCAL_REPO
else
    # ...if yes, cd into it, run the uninstall script, and pull down any new updates from the remote repo
    cd $XONE_LOCAL_REPO
    sudo ./uninstall.sh
    git pull
fi

# run the xone install and get-firmware scripts
sudo ./install.sh --release
sudo xone-get-firmware.sh --skip-disclaimer

# re-enable read-only filesystem
sudo steamos-readonly enable

read -p "Done. You may now safely close the window." -n1 -s

genna87 avatar Feb 20 '23 22:02 genna87

Hmm, I'll need to think if I want to include this. Thus far, all functionality has specifically been without needing to disable the read-only fs.

I'm open to maybe adding it to an "experimental" tab if the response is good enough, so please react to the post above if you want it!

CryoByte33 avatar Feb 21 '23 03:02 CryoByte33

You can make systemd units that will reinstall your stuff automatically after update, since you already have it scripted. Nix on Steam Deck uses this to have a persistent nix installation, for example. You can read more here

bugworm avatar Feb 21 '23 17:02 bugworm

You can make systemd units that will reinstall your stuff automatically after update, since you already have it scripted. Nix on Steam Deck uses this to have a persistent nix installation, for example. You can read more here

Interesting, I'd never considered using systemd to persist these changes 🤔 Definitely an interesting idea. I'll play around with the idea and see if I can get something working in the next few weeks.

CryoByte33 avatar Feb 22 '23 07:02 CryoByte33

@genna87 does running your script break the ability to launch CryoUtilities? I've seen several users with libc errors after using pacman.

CryoByte33 avatar Feb 22 '23 07:02 CryoByte33

@genna87 does running your script break the ability to launch CryoUtilities? I've seen several users with libc errors after using pacman.

I don't have issues, but I'll try re-executing it to see if it affects Cryoutilities as soon as I can

genna87 avatar Feb 22 '23 07:02 genna87

I did not tried it yet, but the last Steam update introduced support for the Xbox Wireless Adapter: https://store.steampowered.com/news/app/1675200/view/3664278558788454929

MAYBE there will be no need to install xone anymore in the near future

genna87 avatar Feb 23 '23 09:02 genna87

PLEASE ADD THIS!!! It is a nightmare to try and install it normally on my steam deck at this time. Having an installer from a reputable dev would be amazing. I just want to play docked with my headset and controller and couch and use the mic on my headset too at the same time :'(

ConvexTlc97 avatar Apr 29 '23 18:04 ConvexTlc97

I can confirm the script still works with SteamOS 3.4.6, but since I already had previously installed xone on an older version, I had to modify the script to backup the fakeroot file before installing packages.

So instead of

# install required packages
sudo pacman-key --init && sudo pacman-key --populate archlinux
sudo pacman -Syu curl wget git base-devel gcc cabextract linux-neptune-headers dkms libisl libmpc

# rename/back up fakeroot.conf to avoid error
sudo mv /etc/ld.so.conf.d/fakeroot.conf /etc/ld.so.conf.d/fakeroot.conf.bck

I did:

# rename/back up fakeroot.conf to avoid error
sudo mv /etc/ld.so.conf.d/fakeroot.conf /etc/ld.so.conf.d/fakeroot.conf.bck

# install required packages
sudo pacman-key --init && sudo pacman-key --populate archlinux
sudo pacman -Syu curl wget git base-devel gcc cabextract linux-neptune-headers dkms libisl libmpc

srosato avatar May 23 '23 23:05 srosato