cruxports/mpc/mpdiradd

19 lines
425 B
Plaintext
Raw Normal View History

2022-02-05 15:39:19 -05:00
#!/usr/bin/env bash
# Description: Add files or directories to the mpd queue
#
# Dependencies: mpd mpc
#
# Shell: bash (for vim pattern matching)
# Author: John McQuah
MPDHOME="/home/mpd/"
target=$1
fullpath="$2/$target"
if [[ -d $target && -x $target ]]; then
argfind="base ${fullpath##$MPDHOME}"
mpc find $argfind | sort | mpc add
else
[[ $fullpath =~ $MPDHOME && -r $fullpath ]] && mpc add "${fullpath##$MPDHOME}"
fi