2021-10-16 08:46:54 +00:00
|
|
|
#!/bin/sh -e
|
2021-10-17 10:23:29 +00:00
|
|
|
# launch my focus playlist or find a matching playlist or song files
|
|
|
|
# depends: mp mpc
|
|
|
|
# env: MUSIC
|
|
|
|
PLAYLISTS="$MUSIC/Playlists"
|
2021-10-22 15:14:41 +00:00
|
|
|
mpc -q clear
|
2021-10-16 08:46:54 +00:00
|
|
|
if test -z "$1"
|
2021-10-17 10:23:29 +00:00
|
|
|
then mp -q "$PLAYLISTS/focus.m3u"
|
2021-10-16 08:46:54 +00:00
|
|
|
else
|
2021-10-17 10:23:29 +00:00
|
|
|
(find -L $PLAYLISTS -iname "focus-$1.m3u" -print0 | grep --null-data . ||
|
|
|
|
find -L $PLAYLISTS -iname "$1.m3u*" -print0 | grep --null-data . ||
|
2021-10-16 08:46:54 +00:00
|
|
|
find -L $MUSIC -iname "*$1*" -prune -exec find {} -size +2M -type f -not -iregex ".*.\(jpe?g\|png\)" -print0 \; ) |
|
|
|
|
xargs -0 mp -q
|
|
|
|
fi
|
|
|
|
mpc -q shuffle
|
|
|
|
mpc next
|