From 26d6630f5b396964efb6df5cf424d536a59e5329 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 6 May 2026 13:07:26 +0200 Subject: Add install script, shell completions, and systemd service - Add install.sh script that builds release, stops daemon, and installs binary - Add shell completions for bash, zsh, and fish - Add systemd user service unit file - Add public binary declaration in Cargo.toml - Add install command to CLI - Make current_track field public for MPRIS integration (placeholder) --- completions/rsp.bash | 26 ++++++++++++++++++++++++++ completions/rsp.fish | 11 +++++++++++ completions/rsp.zsh | 26 ++++++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 completions/rsp.bash create mode 100644 completions/rsp.fish create mode 100644 completions/rsp.zsh (limited to 'completions') diff --git a/completions/rsp.bash b/completions/rsp.bash new file mode 100644 index 0000000..55a25b0 --- /dev/null +++ b/completions/rsp.bash @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +_rsp() { + local cur prev words cword + _init_completion || return + + case $prev in + rsp) + COMPREPLY=($(compgen -W "start stop restart play pause resume next previous volume shuffle queue status scan settings" -- "$cur")) + ;; + play) + _filedir + ;; + volume) + COMPREPLY=($(compgen -W "0 10 20 30 40 50 60 70 80 90 100" -- "$cur")) + ;; + shuffle) + COMPREPLY=($(compgen -W "on off album" -- "$cur")) + ;; + settings) + COMPREPLY=($(compgen -W "get set list unset" -- "$cur")) + ;; + esac +} + +complete -F _rsp rsp diff --git a/completions/rsp.fish b/completions/rsp.fish new file mode 100644 index 0000000..1fd7483 --- /dev/null +++ b/completions/rsp.fish @@ -0,0 +1,11 @@ +# rsp fish completion + +complete -c rsp -n '__fish_use_subcommand' -a 'start stop restart play pause resume next previous volume shuffle queue status scan settings' -d 'Command' + +complete -c rsp -n '__fish_seen_subcommand_from play' -f -d 'Audio file or directory' + +complete -c rsp -n '__fish_seen_subcommand_from volume' -a '0 10 20 30 40 50 60 70 80 90 100' -d 'Volume level' + +complete -c rsp -n '__fish_seen_subcommand_from shuffle' -a 'on off album' -d 'Shuffle mode' + +complete -c rsp -n '__fish_seen_subcommand_from settings' -a 'get set list unset' -d 'Settings command' diff --git a/completions/rsp.zsh b/completions/rsp.zsh new file mode 100644 index 0000000..c07feb1 --- /dev/null +++ b/completions/rsp.zsh @@ -0,0 +1,26 @@ +#compdef rsp + +_rsp() { + _arguments -C \ + '1:command:->cmd' \ + '*::args:->args' + + case $state in + cmd) + _values 'command' \ + 'start' 'stop' 'restart' 'play' 'pause' 'resume' 'next' 'previous' \ + 'volume' 'shuffle' 'queue' 'status' 'scan' 'settings' + ;; + args) + # if first word is "play", complete files/dirs + if [[ $words[1] == play || $words[2] == play ]]; then + _files + else + # default: complete nothing (or you can list other subcommand args) + return 0 + fi + ;; + esac +} + +compdef _rsp rsp -- cgit v1.2.3