From 295a8377afc81a76768d6b35147325cd204dcd3b Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 29 Apr 2020 15:29:45 +0100 Subject: [PATCH] bin/media-keys: Actually print the name of the person who picked a track. Might as well since it's lying about. --- bin/media-keys | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; } -- 2.11.0