-
-
Save BenjaminLawson/9eb814049d48b4b806f8f57c0e8b8650 to your computer and use it in GitHub Desktop.
Shell script to replace mpd's playlist with the results of a Beets query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Replace the mpd playlist with the results of a Beets query | |
# Usage: 'bmpc QUERY' | |
# change BEETS_DIR to the name of your beets music directory | |
BEETS_DIR="beets" | |
RESULTS=$(beet ls -f '$path' "$@" | sed "s/.*\/$BEETS_DIR\///") | |
printf "$RESULTS\n\n" | |
mpc clear >/dev/null | |
printf "$RESULTS" | mpc add | |
mpc play |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment