Created
May 6, 2025 12:51
-
-
Save NoXPhasma/f2bb80dd70261f3cb1974090c836dea7 to your computer and use it in GitHub Desktop.
Simple script to install xone on the Steam Deck
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Author: NoXPhasma | |
# Version: 1.0.0 | |
# xone discord: https://discord.gg/FDQxwWk | |
### CONFIGURATION START | |
TARGET="$HOME/xone" | |
REPO_URL="https://github.com/dlundqvist/xone.git" | |
PACKAGES="base-devel cabextract curl dkms gcc git libisl libmpc linux-neptune-65-headers pahole wget" | |
### CONFIGURATION END | |
# Colors | |
RED="\033[0;31m" | |
CYAN="\033[1;36m" | |
PINK="\033[1;16m" | |
PINK="\033[38;5;205m" | |
NC="\033[0m" # No Color | |
# version | |
VERSION="1.0.0" | |
if [ "$(whoami)" = root ] | |
then | |
echo -e "\n${RED}Please don't run this script as root!${NC}\n" | |
echo "You will be prompted for your sudo password, if needed." | |
exit 1 | |
fi | |
# User prompt and notice | |
echo -e "\n${CYAN} Steam Deck xone installer (${VERSION})${NC}" | |
echo -e "${CYAN}------------------------------------------------------------${NC}" | |
echo "This script will install the xone kernel module on your Steam Deck." | |
echo | |
echo "The following settings are applied (can be changed in the header of this file):" | |
echo -e "${CYAN}Xone Repository:${NC} ${PINK}$REPO_URL${NC}" | |
echo -e "${CYAN}Target folder:${NC} ${PINK}$TARGET${NC}" | |
echo -e "${CYAN}Packages to install:${NC} ${PINK}$PACKAGES${NC}" | |
echo | |
echo "You will be prompted to enter your password for 'sudo' access, if needed." | |
echo -e "\nPlease ensure you understand what this script does before proceeding." | |
echo -e "${CYAN}------------------------------------------------------------${NC}" | |
read -rp "Do you want to continue? [y/N]: " confirm | |
# Proceed only if the user confirms with Y/y | |
if [[ ! "$confirm" =~ ^[Yy]$ ]]; then | |
echo -e "${RED}Installation aborted by user.${NC}" | |
exit 0 | |
fi | |
# Check for --fixinstall parameter | |
if [[ "$1" == "--fixbrokeninstall" ]]; then | |
echo -e "\n${CYAN}==> Fixbrokeninstall:${NC} Will try to install needed files\n" | |
cd "$TARGET" || exit 1 | |
sudo install -D -m 644 install/modprobe.conf /etc/modprobe.d/xone-blacklist.conf | |
sudo install -D -m 755 install/firmware.sh /usr/local/bin/xone-get-firmware.sh | |
echo -e "\n${CYAN}Task completed${NC}\n" | |
exit 0 | |
fi | |
# 1. Enable write access on Steam Deck's read-only filesystem | |
echo -e "\n${CYAN}==> Step 1:${NC} Enabling write access to the filesystem...\n" | |
sudo steamos-readonly disable | |
# 2. Initialize and populate pacman keyring | |
echo -e "${CYAN}==> Step 2:${NC} Initializing and populating pacman keyring..." | |
sudo pacman-key --init | |
sudo pacman-key --populate archlinux | |
sudo pacman-key --populate | |
# 3. Install required packages for xone | |
echo -e "\n${CYAN}==> Step 3:${NC} Installing required packages...\n" | |
sudo pacman -Syu --noconfirm "$PACKAGES" | |
# 4. Clone or update xone repository | |
if [ -d "$TARGET" ]; then | |
echo -e "\n${CYAN}==> Step 4:${NC} '$TARGET' directory already exists. Pulling latest changes...\n" | |
echo "4) '$TARGET' directory already exists. Pulling latest changes..." | |
cd "$TARGET" || exit 1 | |
git pull | |
else | |
echo -e "\n${CYAN}==> Step 4:${NC} Cloning xone repository...\n" | |
git clone "$REPO_URL" "$TARGET" | |
cd "$TARGET" || exit 1 | |
fi | |
# 5. Run xone installer | |
echo -e "\n${CYAN}==> Step 5:${NC} Running xone installation...\n" | |
sudo ./install.sh | |
# 6. Install firmware for the dongle | |
echo -e "\n${CYAN}==> Step 6:${NC} Installing firmware for the dongle...\n" | |
sudo xone-get-firmware.sh --skip-disclaimer | |
echo -e "\n${CYAN}Installation complete!${NC}\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment