aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
diff options
context:
space:
mode:
authorsalmonik <raisersoft@proton.me>2026-05-13 11:27:16 +0200
committersalmonik <raisersoft@proton.me>2026-05-13 11:27:16 +0200
commit1059d878476c231f84ef9d3c2e8bcafaf978bc87 (patch)
tree91a5ac153299764efcb8cf439ca7751152a34274 /install.sh
parentAdd display_format config, fix restart command, clean up config code (diff)
downloadrsplayer-1059d878476c231f84ef9d3c2e8bcafaf978bc87.tar.gz
rsplayer-1059d878476c231f84ef9d3c2e8bcafaf978bc87.zip
Regenerate shell completions and install script fixes
- Add hidden completions subcommand to CLI (developer use only) - Regenerate all completion scripts from current CLI structure - Add elvish and powershell completion scripts - install.sh: Fix rsp stop -> rsp stop-daemon, rsp start -> rsp start-daemon - install.sh: Install completions for user's current shell - install.sh: Zsh uses /usr/share/zsh/site-functions/_rsp directly
Diffstat (limited to '')
-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."