aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh40
1 files changed, 38 insertions, 2 deletions
diff --git a/install.sh b/install.sh
index 5a1e888..a7317e9 100755
--- a/install.sh
+++ b/install.sh
@@ -6,7 +6,7 @@ cargo build --release
6 6
7echo "Stopping existing daemon..." 7echo "Stopping existing daemon..."
8systemctl --user stop rsplayer 2>/dev/null || true 8systemctl --user stop rsplayer 2>/dev/null || true
9rsp stop 2>/dev/null || true 9rsp stop-daemon 2>/dev/null || true
10 10
11echo "Installing to /usr/bin/rsp..." 11echo "Installing to /usr/bin/rsp..."
12sudo cp target/release/rsp /usr/bin/rsp 12sudo cp target/release/rsp /usr/bin/rsp
@@ -26,4 +26,40 @@ else
26fi 26fi
27 27
28echo "" 28echo ""
29echo "Done! Run 'rsp start' to start the daemon." 29echo "Installing shell completions..."
30SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
31shell_name=$(basename "${SHELL:-}")
32case "$shell_name" in
33 bash)
34 dest="${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion/completions"
35 mkdir -p "$dest"
36 cp "$SCRIPT_DIR/completions/rsp.bash" "$dest/rsp"
37 echo " → Bash completions: $dest/rsp"
38 ;;
39 zsh)
40 dest="/usr/share/zsh/site-functions/_rsp"
41 sudo cp "$SCRIPT_DIR/completions/rsp.zsh" "$dest"
42 echo " → Zsh completions: $dest"
43 ;;
44 fish)
45 dest="$HOME/.config/fish/completions/rsp.fish"
46 mkdir -p "$(dirname "$dest")"
47 cp "$SCRIPT_DIR/completions/rsp.fish" "$dest"
48 echo " → Fish completions: $dest"
49 ;;
50 elvish)
51 dest="$HOME/.config/elvish/rc.d/rsp.elvish"
52 mkdir -p "$(dirname "$dest")"
53 cp "$SCRIPT_DIR/completions/rsp.elvish" "$dest"
54 echo " → Elvish completions: $dest"
55 ;;
56 powershell)
57 echo " → PowerShell: source \"$SCRIPT_DIR/completions/rsp.powershell\" from your profile"
58 ;;
59 *)
60 echo " → Unrecognized shell '$shell_name'; completion files are in $SCRIPT_DIR/completions/"
61 ;;
62esac
63
64echo ""
65echo "Done! Run 'rsp start-daemon' to start the daemon."