bin/mp: add option to start track in the middle
This commit is contained in:
parent
d0715267f8
commit
3fc358fd1d
|
@ -8,9 +8,8 @@ LINKS="$MUSIC/links"
|
|||
if test "$1" = "-r"
|
||||
then shift
|
||||
test "$1" = "-v" && verbose=-v && shift
|
||||
for arg;
|
||||
do
|
||||
path="$(test -e "$arg" && realpath "$arg" ||
|
||||
for arg
|
||||
do path="$(test -e "$arg" && realpath "$arg" ||
|
||||
( test -e "$MUSIC/$arg" && realpath "$MUSIC/$arg") ||
|
||||
( test -e "$PLAYLISTS/$arg" && realpath "$PLAYLISTS/$arg") )"
|
||||
test -n "$verbose" && echo "Scanning path '$path' $(test "$arg" != "$path" && echo "from '$arg' ")(MUSIC: '$MUSIC', PWD: '$PWD')" >&2
|
||||
|
@ -29,8 +28,10 @@ then shift
|
|||
else
|
||||
test "$1" = "-q" && quiet=-q && shift
|
||||
test -n "$(mpc playlist)" && next=-q
|
||||
test "$1" = "--seek" && seek=-q
|
||||
{ "$0" -r "$@" && mpc -q update --wait; } | #tee /tmp/mp 2>&1
|
||||
xargs --delim='\n' mpc insert
|
||||
mpc ${quiet:-$next} play
|
||||
test -z "$next" || mpc $quiet next
|
||||
mpc ${quiet:-${next:-$seek}} play
|
||||
test -z "$next" || mpc ${quiet:-$seek} next
|
||||
test -z "$seek" || mpc $quiet seek "30%"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue