diff options
author | Rasmus Steinke <rasi@xssn.at> | 2016-01-28 19:44:32 +0100 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2016-01-28 19:44:32 +0100 |
commit | a61c2c3795dc303bcf16695e6c3be17486da8a4d (patch) | |
tree | 2ffa0da59e2a4b8c5a8c537e7c145c1381b83cc8 | |
parent | d6d6005ce2557477e799bddddc99b314ff1071a3 (diff) | |
download | perl-app-clerk-a61c2c3795dc303bcf16695e6c3be17486da8a4d.tar.gz perl-app-clerk-a61c2c3795dc303bcf16695e6c3be17486da8a4d.tar.xz |
add playlist menu command line argument
-rwxr-xr-x | clerk | 68 |
1 files changed, 39 insertions, 29 deletions
@@ -823,16 +823,7 @@ songs () { addTrackTags elif [[ $val -eq 23 ]]; then - plmenu=$(echo -e "< Return\n---\n1 [ Load Playlist ]\n2 [ Save Playlist ]" | dmenu_t -auto-select -dmenu -p "Load/Save Playlist > ") - if [[ $plmenu == "1"* ]]; then - dplayQueueLoad - elif [[ $plmenu == "2"* ]]; then - dplayQueueSave - elif [[ $plmenu == "< Return" ]]; then - dplayQueue - elif [[ $plmenu == "" ]]; then - exit - fi + plMenu elif [[ $val -eq 24 ]]; then mpc next @@ -1000,6 +991,19 @@ songs () { done } +plMenu () { + plmenu=$(echo -e "< Return\n---\n1 [ Load Playlist ]\n2 [ Save Playlist ]" | dmenu_t -auto-select -dmenu -p "Load/Save Playlist > ") + if [[ $plmenu == "1"* ]]; then + dplayQueueLoad + elif [[ $plmenu == "2"* ]]; then + dplayQueueSave + elif [[ $plmenu == "< Return" ]]; then + dplayQueue + elif [[ $plmenu == "" ]]; then + exit + fi +} + skipAlbum () { IFS=' ' @@ -1465,12 +1469,16 @@ ${line2}</span>" disc=$(mpc find -f '%disc%' date "$date" album "$album" albumartist "$artist" | uniq) if [[ $(echo "$disc" | wc -l) -gt 1 ]]; then discmenu=$(echo -e "All\n$disc" | rofi -dmenu -p "Choose Disc > ") - if [[ $discmenu == "" ]]; then exit; fi - mpc clear - mpc findadd date "$date" album "$album" albumartist "$artist" disc "$discmenu" - else - mpc clear - mpc findadd date "$date" album "$album" albumartist "$artist"; + if [[ $discmenu == "" ]]; then exit + elif [[ $discmenu == "All" ]]; then + mpc clear + echo -e "All\n$disc" | tail -n +2 | while read discline; do + mpc findadd date "$date" album "$album" albumartist "$artist" disc "$discline" + done + else + mpc clear + mpc findadd date "$date" album "$album" albumartist "$artist" disc "$discmenu" + fi fi done mpc play @@ -2045,6 +2053,8 @@ while :; do --playlist) if [[ $2 == savealbum ]]; then saveAlbumToPlaylist + elif [[ $2 == menu ]]; then + plMenu elif [[ $2 == savelast ]]; then saveLatestToPlaylist elif [[ $2 == savetrack ]]; then @@ -2077,30 +2087,30 @@ while :; do echo "Copyright © 2013 - 2015 Rasmus Steinke" echo "---" echo "General" - echo " --help, -h this help message" - echo " --current show currently playing track" - echo " --update update album/track caches" + echo " --help, -h this help message" + echo " --current show currently playing track" + echo " --update update album/track caches" echo "" echo "Library" - echo " --add <track, album, latest> adds selection at the end of the queue" - echo " --random <track, album> play random track or album" + echo " --add <track, album, latest> adds selection at the end of the queue" + echo " --random <track, album> play random track or album" echo "" echo "Playlist" - echo " --queue <show, suspend, resume> manage current queue" - echo " --playlist <savealbum, savelast, savetrack> save selection to playlist \"clerk\"" - echo " --rss load podcast" + echo " --queue <show, suspend, resume> manage current queue" + echo " --playlist <menu, savealbum, savelast, savetrack> save selection to playlist \"clerk\"" + echo " --rss load podcast" echo " (podcast should be placed in ~/.config/clerk/podcasts" echo " with format NAME \ URL)" echo "" echo "Ratings" - echo " --rate <menu, track, album, load, instant ##> rate albums or tracks" - echo " "load" adds random rated tracks to queue" + echo " --rate <menu, track, album, load, instant ##> rate albums or tracks" + echo " "load" adds random rated tracks to queue" echo "" - echo " --backup <track, album> backup ratings from mpd sticker database to json file." - echo " --restore <track, album> restore ratings back to mpd sticker database" + echo " --backup <track, album> backup ratings from mpd sticker database to json file." + echo " --restore <track, album> restore ratings back to mpd sticker database" echo "" echo "LastFM" - echo " --lastfm <toggle, check, love> toggle or check last.fm status, love current track" + echo " --lastfm <toggle, check, love> toggle or check last.fm status, love current track" break ;; *) |