repo: music action: commit revision: path_from: revision_from: ebf0dd3bd2641c96a6f0053d2ff973fbb030d4b7: path_to: revision_to:
commit ebf0dd3bd2641c96a6f0053d2ff973fbb030d4b7 Author: epochDate: Mon Nov 18 23:16:16 2019 -0600 added scripts to collect the now playing file and display the id3 tags nicely diff --git a/music-fileinfo b/music-fileinfo new file mode 100755 index 0000000000000000000000000000000000000000..8b8c250491729e04df53559a4701791d7b7c34b0 --- /dev/null +++ b/music-fileinfo @@ -0,0 +1,12 @@ +#!/bin/bash +data="$(id3v2 -R "$1")" +#echo $data +artist="$(printf "%s\n" "$data" | grep '^TPE1: ' | cut '-d ' -f2-)" +title="$(printf "%s\n" "$data" | grep '^TIT2: ' | cut '-d ' -f2-)" +album="$(printf "%s\n" "$data" | grep '^TALB: ' | cut '-d ' -f2-)" +year="$(printf "%s\n" "$data" | grep '^TYER: ' | cut '-d ' -f2-)" +if [ "$artist" -a "$title" -a "$album" -a "$year" ];then + printf '"%s" by %s on %s (%s)\n' "$title" "$artist" "$album" "$year" +else + printf "%s\n" "$1" +fi diff --git a/music-nowplaying b/music-nowplaying new file mode 100755 index 0000000000000000000000000000000000000000..2deb640e109767f7a9f60ce87b8a4298b91b0feb --- /dev/null +++ b/music-nowplaying @@ -0,0 +1,7 @@ +#!/bin/sh +if [ "$1" ];then + FILE=$1 +else + FILE=$(cat /proc/$(cat $PREFIX/var/run/music-player.pid)/cmdline | tr '\0' '\n' | tail -n1) +fi +echo $FILE
-----END OF PAGE-----