shell/+mpd: add mpd-add script

This commit is contained in:
Henrik Lissner 2017-09-05 19:15:56 +02:00
parent c35ab1c75b
commit 61ceb57fbf
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 9 additions and 8 deletions

View file

@ -2,11 +2,3 @@
if [[ $OSTYPE == darwin* ]]; then if [[ $OSTYPE == darwin* ]]; then
alias mpdi='mpd ~/.config/mpd/mpd.conf' alias mpdi='mpd ~/.config/mpd/mpd.conf'
fi fi
mpca() {
local files=()
for file in $@; do
files+="$(realpath --relative-to="$HOME/music" "$file")"
done
mpc add ${files[@]}
}

9
shell/+mpd/bin/mpd-add Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Add files (relative to working directory) to current playlist.
local files=()
for file in $@; do
files+="$(realpath --relative-to="$HOME/music" "$file")"
done
mpc add ${files[@]}