summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2015-05-21 21:55:08 +0200
committerRasmus Steinke <rasi@xssn.at>2015-05-21 21:55:08 +0200
commit74921ec503d4a6e76db38eae28b5d4094a6efb61 (patch)
treeedab771be18df988b6e0d50361c1ed0a5ee423b9
parentf6a2219384d84a46aa8ee0e4d96d555e7e5a9093 (diff)
downloadperl-app-clerk-74921ec503d4a6e76db38eae28b5d4094a6efb61.tar.gz
perl-app-clerk-74921ec503d4a6e76db38eae28b5d4094a6efb61.tar.xz
fix wrong variables
-rwxr-xr-xclerk13
1 files changed, 7 insertions, 6 deletions
diff --git a/clerk b/clerk
index 502f91e..9fa8dcd 100755
--- a/clerk
+++ b/clerk
@@ -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