From 33548799797596e05fcd26d5a1f97b4163770597 Mon Sep 17 00:00:00 2001 From: Alex Kretzschmar Date: Mon, 23 Jun 2025 16:59:30 -0400 Subject: [PATCH] Fix Konsole PATH issue on Steam Deck with user shell profile updates - Add PATH entries to .bashrc and .bash_profile for Konsole compatibility - Create .bash_profile if missing on Steam Deck with proper ownership - Keep existing /etc/profile.d/ approach for SSH sessions - Prevent duplicate PATH entries with existence checks - Update uninstall script to clean up user shell profile entries - Use sed to remove Tailscale PATH entries during uninstall Fixes #38 --- tailscale.sh | 18 ++++++++++++++++++ uninstall.sh | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/tailscale.sh b/tailscale.sh index a4f15fa..94ba14d 100644 --- a/tailscale.sh +++ b/tailscale.sh @@ -75,6 +75,24 @@ if [ -f /etc/os-release ] && (grep -q "ID=steamos" /etc/os-release || grep -q "V echo 'PATH="$PATH:/home/deck/.local/bin:/opt/tailscale"' >> /etc/profile.d/tailscale.sh source /etc/profile.d/tailscale.sh fi + + # Also add to user's shell profile for Konsole compatibility + # Add to .bashrc if it exists and doesn't already contain the PATH + if [ -f /home/deck/.bashrc ] && ! grep -q "/home/deck/.local/bin" /home/deck/.bashrc; then + echo 'export PATH="$PATH:/home/deck/.local/bin:/opt/tailscale"' >> /home/deck/.bashrc + fi + + # Add to .bash_profile if it exists and doesn't already contain the PATH + if [ -f /home/deck/.bash_profile ] && ! grep -q "/home/deck/.local/bin" /home/deck/.bash_profile; then + echo 'export PATH="$PATH:/home/deck/.local/bin:/opt/tailscale"' >> /home/deck/.bash_profile + fi + + # Create .bash_profile if it doesn't exist (common on Steam Deck) + if [ ! -f /home/deck/.bash_profile ]; then + echo 'export PATH="$PATH:/home/deck/.local/bin:/opt/tailscale"' > /home/deck/.bash_profile + chown deck:deck /home/deck/.bash_profile + fi + else # Other systems - use /usr/local/bin SYMLINK_DIR="/usr/local/bin" diff --git a/uninstall.sh b/uninstall.sh index 9867710..64ae7e2 100644 --- a/uninstall.sh +++ b/uninstall.sh @@ -7,6 +7,11 @@ rm -f /etc/profile.d/tailscale.sh # Remove symlinks from both possible locations (Steam Deck and other systems) rm -f /usr/local/bin/tailscale /usr/local/bin/tailscaled rm -f /home/deck/.local/bin/tailscale /home/deck/.local/bin/tailscaled +# Remove PATH entries from user shell profiles +sed -i '/\/home\/deck\/.local\/bin.*tailscale/d' /home/deck/.bashrc 2>/dev/null || true +sed -i '/\/home\/deck\/.local\/bin.*tailscale/d' /home/deck/.bash_profile 2>/dev/null || true +sed -i '/\/opt\/tailscale/d' /home/deck/.bashrc 2>/dev/null || true +sed -i '/\/opt\/tailscale/d' /home/deck/.bash_profile 2>/dev/null || true # Remove specific Tailscale binaries rm -f /opt/tailscale/tailscale rm -f /opt/tailscale/tailscaled