Fix Steam Deck PATH issue with proper detection and adaptive symlinks

- Add proper Steam Deck detection using ID=steamos and VARIANT_ID=steamdeck
- Use /home/deck/.local/bin for symlinks on Steam Deck (avoids read-only /usr/local/bin)
- Fall back to /usr/local/bin on other systems
- Ensure target directories exist before creating symlinks
- Add both ~/.local/bin and /opt/tailscale to PATH on Steam Deck
- Update uninstall script to clean up symlinks from both locations
- Keep profile.d sourcing for immediate availability in current session

Fixes #38
This commit is contained in:
Alex Kretzschmar
2025-06-23 16:54:00 -04:00
parent d79c4acec2
commit b1fa9edf12

View File

@@ -65,14 +65,26 @@ chmod +x /opt/tailscale/tailscaled
# Create symbolic links for PATH access # Create symbolic links for PATH access
# On Steam Deck, /usr/local/bin is read-only, so use ~/.local/bin instead # On Steam Deck, /usr/local/bin is read-only, so use ~/.local/bin instead
if [ -f /etc/os-release ] && grep -q "steamdeck" /etc/os-release; then if [ -f /etc/os-release ] && (grep -q "ID=steamos" /etc/os-release || grep -q "VARIANT_ID=steamdeck" /etc/os-release); then
# Steam Deck detected - use ~/.local/bin # Steam Deck detected - use ~/.local/bin
SYMLINK_DIR="/home/deck/.local/bin" SYMLINK_DIR="/home/deck/.local/bin"
mkdir -p "$SYMLINK_DIR" mkdir -p "$SYMLINK_DIR"
# Create the profile script with both paths for Steam Deck
if ! test -f /etc/profile.d/tailscale.sh; then
echo 'PATH="$PATH:/home/deck/.local/bin:/opt/tailscale"' >> /etc/profile.d/tailscale.sh
source /etc/profile.d/tailscale.sh
fi
else else
# Other systems - use /usr/local/bin # Other systems - use /usr/local/bin
SYMLINK_DIR="/usr/local/bin" SYMLINK_DIR="/usr/local/bin"
mkdir -p "$SYMLINK_DIR" mkdir -p "$SYMLINK_DIR"
# Create the profile script for other systems
if ! test -f /etc/profile.d/tailscale.sh; then
echo 'PATH="$PATH:/opt/tailscale"' >> /etc/profile.d/tailscale.sh
source /etc/profile.d/tailscale.sh
fi
fi fi
# Remove existing symlinks first if they exist # Remove existing symlinks first if they exist
@@ -82,12 +94,6 @@ rm -f "$SYMLINK_DIR/tailscale" "$SYMLINK_DIR/tailscaled"
ln -s /opt/tailscale/tailscale "$SYMLINK_DIR/tailscale" ln -s /opt/tailscale/tailscale "$SYMLINK_DIR/tailscale"
ln -s /opt/tailscale/tailscaled "$SYMLINK_DIR/tailscaled" ln -s /opt/tailscale/tailscaled "$SYMLINK_DIR/tailscaled"
# Also add to profile.d as fallback for environments where symlink directory isn't in PATH
if ! test -f /etc/profile.d/tailscale.sh; then
echo 'PATH="$PATH:/opt/tailscale"' >> /etc/profile.d/tailscale.sh
source /etc/profile.d/tailscale.sh
fi
# copy the systemd file into place # copy the systemd file into place
cp -rf $tar_dir/systemd/tailscaled.service /etc/systemd/system/tailscaled.service cp -rf $tar_dir/systemd/tailscaled.service /etc/systemd/system/tailscaled.service