bin: tiny music helper fixes

This commit is contained in:
xeruf 2023-05-25 21:31:44 +01:00
parent d74eef021f
commit c5500b3ee0
3 changed files with 8 additions and 2 deletions

6
.local/bin/scripts/keys Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# Lists the keys for each given song
for arg
do echo -n "$arg: "
keyfinder-cli "$arg"
done

View File

@ -1,6 +1,6 @@
#!/bin/sh
# [M]edia [P]lay
# Play given files on mpd, playing external files through symlinking and recursively resolving playlists
# Add matchings songs to mpd queue, playing external files through symlinking and recursively resolving playlists
# depends: xargs realpath mpc
# env: MUSIC
# TODO auto-convert unknown types with ffmpeg to flac rather than linking (wav, opus, ...)

View File

@ -28,7 +28,7 @@ case $command in
(fix) sed -i 's/.*\/\(musi[kc]\|janek\)/../g' "$@";;
(cd) dir="${2:-cd}"
mkdir "$dir"
cat "$1" | python -c "import sys, urllib as ul; [sys.stdout.write(ul.unquote_plus(l)) for l in sys.stdin]" | sed '=' | sed -r 's/^[0-9]$/0\0/' | sed -r "N; s/(.*)\n(.*\/[0-9 ]*(.*))/'\2'\n'$dir\/\1 \3'/" | xargs -L 2 cp;;
cat "$1" | python2 -c "import sys, urllib as ul; [sys.stdout.write(ul.unquote_plus(l)) for l in sys.stdin]" | sed '=' | sed -r 's/^[0-9]$/0\0/' | sed -r "N; s/(.*)\n(.*\/[0-9 ]*(.*))/'\2'\n'$dir\/\1 \3'/" | xargs -L 2 cp;;
(*) echo "Unknown subcommand '$1' - Possible subcommands:
update - update file paths for moved songs in a playlist
edit - open playlist in default editor