Skip to content

Instantly share code, notes, and snippets.

@kwahoo2
Created February 25, 2025 22:14
Show Gist options
  • Save kwahoo2/3b74ed665ea70ca52b52c5f5e22621c6 to your computer and use it in GitHub Desktop.
Save kwahoo2/3b74ed665ea70ca52b52c5f5e22621c6 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
# Steam Deck UNOFFCIAL Tilt Five install script
# Save to a directory with the tiltfive_driver_1.4.1_amd64.unpacked_debs.tar.xz archive
# chmod +x steamdeck-install.sh
# sudo sh ./steamdeck-install.sh
# Adjust paths if necessary
TILTFIVE_HOME_DIR="/var/opt/tiltfive"
TILTFIVE_SERVICE_DIR="tiltfive_driver_1.4.1_amd64.unpacked_debs/tiltfive-service_1.4.1_amd64/files"
TILTFIVE_CONTROL_PANEL_DIR="tiltfive_driver_1.4.1_amd64.unpacked_debs/tiltfive-control-panel_1.4.1_amd64/files"
# Adjust archive filename if necessary
tar -xf tiltfive_driver_1.4.1_amd64.unpacked_debs.tar.xz
steamos-readonly disable
# Create a T5 user
if ! id -u tiltfive >/dev/null 2>&1; then
useradd -r -s /usr/bin/nologin -d "$TILTFIVE_HOME_DIR" -U tiltfive
fi
# Create T5 dirs
install -g tiltfive -o tiltfive -m 0775 -d "/opt/tiltfive"
install -g tiltfive -o tiltfive -m 0775 -d "/opt/tiltfive/bin"
install -g tiltfive -o tiltfive -m 0775 -d "$TILTFIVE_HOME_DIR"
install -g tiltfive -o tiltfive -m 0775 -d "$TILTFIVE_HOME_DIR/firmware"
install -g tiltfive -o tiltfive -m 0775 -d "$TILTFIVE_HOME_DIR/log"
# Copy tiltfive-service files
cp $TILTFIVE_SERVICE_DIR/etc/systemd/system/tiltfive.service /etc/systemd/system/
cp $TILTFIVE_SERVICE_DIR/lib/udev/rules.d/40-tiltfive.rules /lib/udev/rules.d/
cp $TILTFIVE_SERVICE_DIR/opt/tiltfive/LICENSE.service.txt /opt/tiltfive/
cp $TILTFIVE_SERVICE_DIR/opt/tiltfive/bin/tiltfive-service /opt/tiltfive/bin/
cp $TILTFIVE_SERVICE_DIR/var/opt/tiltfive/firmware/hmd-firmware $TILTFIVE_HOME_DIR/firmware/
# Set user and group
chown tiltfive:tiltfive /etc/systemd/system/tiltfive.service
chown tiltfive:tiltfive /lib/udev/rules.d/40-tiltfive.rules
chown tiltfive:tiltfive /opt/tiltfive/LICENSE.service.txt
chown tiltfive:tiltfive /opt/tiltfive/bin/tiltfive-service
chown tiltfive:tiltfive $TILTFIVE_HOME_DIR/firmware/hmd-firmware
chmod +x /opt/tiltfive/bin/tiltfive-service
# Start the service
systemctl start tiltfive.service
echo "tiltfive-service has been installed."
# Copy tiltfive-control-panel files
cp -r $TILTFIVE_CONTROL_PANEL_DIR/opt/tiltfive/control-panel/ /opt/tiltfive/
cp $TILTFIVE_CONTROL_PANEL_DIR/opt/tiltfive/LICENSE.control-panel.txt /opt/tiltfive/
cp $TILTFIVE_CONTROL_PANEL_DIR/usr/share/applications/tiltfive-control-panel.desktop /usr/share/applications/
# Set user and group
chown -R tiltfive:tiltfive /opt/tiltfive/
chown tiltfive:tiltfive /usr/share/applications/tiltfive-control-panel.desktop
echo "tiltfive-control-panel has been installed."
# Add usbfs memory value to GRUB - required for more than single pair of glasses, since default value is just 16MiB
GRUB_CONFIG="/etc/default/grub"
OPTION_NAME="usbcore.usbfs_memory_mb"
NEW_VALUE="256"
if grep -q "$OPTION_NAME" "$GRUB_CONFIG"; then
sed -i "s/\($OPTION_NAME=\)[0-9]\+/\1$NEW_VALUE/" "$GRUB_CONFIG"
echo "$OPTION_NAME updated to $NEW_VALUE in $GRUB_CONFIG."
else
sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=\"\(.*\)\"/GRUB_CMDLINE_LINUX_DEFAULT=\"\1 $OPTION_NAME=$NEW_VALUE\"/" "$GRUB_CONFIG"
echo "$OPTION_NAME=$NEW_VALUE added to $GRUB_CONFIG."
fi
update-grub
echo "GRUB has been updated."
steamos-readonly enable
echo "Tilt Five has been installed successfully. Please reboot the Steam Deck."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment