diff options
author | Rasmus Steinke <rasi@xssn.at> | 2014-08-06 20:27:44 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2014-08-06 20:27:44 +0200 |
commit | e925fce327227295c551e5fee4e9782363af48e3 (patch) | |
tree | 314f6def8066298e41af4f206fcfe548b6f3ad62 /clerk | |
parent | ddc0f63ed2088ae6d2873689db67ef74e35416d8 (diff) | |
download | perl-app-clerk-e925fce327227295c551e5fee4e9782363af48e3.tar.gz perl-app-clerk-e925fce327227295c551e5fee4e9782363af48e3.tar.xz |
cleaned up current queue menu
Diffstat (limited to 'clerk')
-rwxr-xr-x | clerk | 40 |
1 files changed, 21 insertions, 19 deletions
@@ -350,17 +350,11 @@ crossfadePrompt () { esac } - -dplayQueue () { +managePlaylists () { while read TRACKDISPLAY do - TITLE=$(echo "$TRACKDISPLAY" | awk -F " $seperator " '{ print $3 }') - ARTIST=$(echo "$TRACKDISPLAY" | awk -F " $seperator " '{ print $2 }') - POS=$(echo "$TRACKDISPLAY" | awk -F " $seperator " '{ print $1 }') - if [[ "$TRACKDISPLAY" == "0 Return to Main Menu" ]]; then - dplayPrompt - elif [[ "$TRACKDISPLAY" == "Mode: Play" ]]; then - dplayQueueDelete + if [[ "$TRACKDISPLAY" == "0 Return to Playlist Menu" ]]; then + dplayQueue elif [[ "$TRACKDISPLAY" == "Load Playlist" ]]; then dplayQueueLoad elif [[ "$TRACKDISPLAY" == "Save Playlist" ]]; then @@ -369,10 +363,24 @@ dplayQueue () { mpc crop && dplayQueue elif [[ "$TRACKDISPLAY" == "Clear Playlist" ]]; then mpc clear && dplayQueue + fi +done < <(export seperator=$seperator; echo -e "0 Return to Playlist Menu\n---\nLoad Playlist\nSave Playlist\nCrop Playlist\nClear Playlist" | dmenu_t -p "Queue") +} + +dplayQueue () { + while read TRACKDISPLAY + do + TITLE=$(echo "$TRACKDISPLAY" | awk -F " $seperator " '{ print $3 }') + ARTIST=$(echo "$TRACKDISPLAY" | awk -F " $seperator " '{ print $2 }') + POS=$(echo "$TRACKDISPLAY" | awk -F " $seperator " '{ print $1 }') + if [[ "$TRACKDISPLAY" == "0 Return to Main Menu" ]]; then + dplayPrompt + elif [[ "$TRACKDISPLAY" == "Manage Playlists" ]]; then + managePlaylists else mpc play $POS; fi - done < <(export seperator=$seperator; echo -e "0 Return to Main Menu\n---\nMode: Play\n---\nLoad Playlist\nSave Playlist\nCrop Playlist\nClear Playlist\n---\n$(mpc playlist --format "%position% $seperator %artist% $seperator %title%")" | dmenu_t -p "Queue") + done < <(export seperator=$seperator; echo -e "0 Return to Main Menu\n---\nMode: Play\n---\nManage Playlists\n---\n$(mpc playlist --format "%position% $seperator %artist% $seperator %title%")" | dmenu_t -p "Queue") } @@ -384,19 +392,13 @@ dplayQueueDelete () { POS=$(echo "$TRACKDISPLAY" | awk -F " $seperator " '{ print $1 }') if [[ "$TRACKDISPLAY" == "0 Return to Main Menu" ]]; then dplayPrompt - elif [[ "$TRACKDISPLAY" == "Mode: Delete" ]]; then - dplayQueue - elif [[ "$TRACKDISPLAY" == "Save Playlist" ]]; then - dplayQueueSave - elif [[ "$TRACKDISPLAY" == "Crop Playlist" ]]; then - mpc crop && dplayQueueDelete - elif [[ "$TRACKDISPLAY" == "Clear Playlist" ]]; then - mpc clear && dplayQueueDelete + elif [[ "$TRACKDISPLAY" == "Manage Playlists" ]]; then + managePlaylists else mpc del $POS; dplayQueue fi - done < <(export seperator=$seperator; echo -e "0 Return to Main Menu\n---\nMode: Delete\n---\nSave Playlist\nCrop Playlist\nClear Playlist\n---\n$(mpc playlist --format "%position% $seperator %artist% $seperator %title%")" | dmenu_t -p "Queue") + done < <(export seperator=$seperator; echo -e "0 Return to Main Menu\n---\nMode: Delete\nManage Playlists\n---\n$(mpc playlist --format "%position% $seperator %artist% $seperator %title%")" | dmenu_t -p "Queue") } dplayQueueLoad () { |