diff options
Diffstat (limited to 'clerk')
-rwxr-xr-x | clerk | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -922,16 +922,14 @@ ${add}: Add, ${insert}: Insert, ${replace}: Replace (Default) --- ${last_temp}" - if [[ -z $line ]]; then - TRACK_TEMP=$(echo -e "${menu}" | dmenu_t -dmenu -format "i:s" -u 2 -p "Choose Album > ") - else - TRACK_TEMP=$(echo -e "${menu}" | dmenu_t -dmenu -l $(( $line + 1 )) -format "i:s" -u 2 -p "Choose Album > ") - fi +TRACK_TEMP=$(echo -e "${menu}" | dmenu_t -dmenu -select "$entry" -filter "$filter" -format "f:s" -u 2 -p "Choose Album > ") val=$? TRACK="${TRACK_TEMP#*:}" - export line="$(echo ${TRACK_TEMP} | awk -F ':' '{ print $1}')" + unset filter + export filter="${TRACK_TEMP%:*}" + if [[ "$TRACK" == "0 Return to Main Menu" ]] then dplayPrompt @@ -946,12 +944,15 @@ ${last_temp}" if [[ $val -eq 11 ]]; then echo "return code is 12" mpc search date "$date" album "$album" albumartist "$artist" | mpc insert + entry="$TRACK" elif [[ $val -eq 0 || $val -eq 12 ]]; then echo "return code is 13" mpc clear && mpc search date "$date" album "$album" albumartist "$artist" | mpc add mpc play + entry="$TRACK" elif [[ $val -eq 10 ]]; then mpc search date "$date" album "$album" albumartist "$artist" | mpc add + entry="$TRACK" elif [[ $val -eq 1 ]]; then exit fi |