CryoByte33 / steam-deck-utilities

A utility to improve performance and help manage storage on Steam Deck.
GNU General Public License v3.0
3.23k stars 80 forks source link

Add tool to install xone #41

Open genna87 opened 1 year ago

genna87 commented 1 year ago

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
CryoByte33 commented 1 year ago

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!

bugworm commented 1 year ago

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

CryoByte33 commented 1 year ago

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 commented 1 year ago

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

genna87 commented 1 year ago

@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 commented 1 year ago

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

ConvexTlc97 commented 1 year ago

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 :'(

srosato commented 1 year ago

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