From: Mark Wooding Date: Wed, 29 Apr 2020 14:29:45 +0000 (+0100) Subject: bin/media-keys: Actually print the name of the person who picked a track. X-Git-Url: https://git.distorted.org.uk/~mdw/profile/commitdiff_plain/295a8377afc81a76768d6b35147325cd204dcd3b?ds=sidebyside bin/media-keys: Actually print the name of the person who picked a track. Might as well since it's lying about. --- diff --git a/bin/media-keys b/bin/media-keys index 6efb018..e2e6dc5 100755 --- a/bin/media-keys +++ b/bin/media-keys @@ -39,10 +39,11 @@ op-now-playing () { track) ;; *) bail "unexpected first-line token \`$k'" ;; esac + unset who read -p k _ case $k in id) ;; *) bail "unexpected second-line token \`$k'" ;; esac - read -p k _ - case $k in picked) read -p k _ ;; esac + read -p k _ name _ + case $k in picked) who=$name; read -p k _ ;; esac case $k in played) ;; *) bail "unexpected third-line token \`$k'" ;; esac read -pA t case $t[-1] in started | ok) st="" ;; paused) st=" (paused)" ;; esac @@ -52,7 +53,8 @@ op-now-playing () { album=$(disorder part $track display album) title=$(disorder part $track display title) case $artist in [A-Z]) artist=$album album= ;; esac - echo "$artist: ‘$title’${album+, from ‘$album’}" + echo "$artist: ‘$title’${album+, from ‘$album’}${who+ +(chosen by $who)}" } op-scratch () { disorder scratch; }