stuff
This commit is contained in:
parent
decdd636d4
commit
a475f2caf3
2 changed files with 65 additions and 5 deletions
|
|
@ -47,13 +47,55 @@ function open_course
|
|||
end
|
||||
|
||||
function select_song
|
||||
set artist (mpc list albumartist | fuzzel --dmenu || exit)
|
||||
set album (mpc list album albumartist $artist | fuzzel --dmenu || exit)
|
||||
set title (mpc list title album $album | fuzzel --dmenu || exit)
|
||||
set state "artist"
|
||||
set song
|
||||
|
||||
mpc findadd album $album
|
||||
mpc searchplay title $title
|
||||
while true
|
||||
if test $state = "title"
|
||||
set song[3] (echo -e "\t..\n $(mpc search --format "%track%\t%title%" album $song[2])" | fuzzel --dmenu --with-nth 2 --accept-nth 2 || exit)
|
||||
|
||||
if test $song[3] = ".."
|
||||
set state "album"
|
||||
else
|
||||
set state ""
|
||||
mpc findadd album $song[2]
|
||||
mpc searchplay title $song[3]
|
||||
break
|
||||
end
|
||||
|
||||
else if test $state = "album"
|
||||
set song[2] (echo -e "..\n$(mpc list album albumartist $song[1])" | fuzzel --dmenu || exit)
|
||||
|
||||
if test $song[2] = ".."
|
||||
set state "artist"
|
||||
else
|
||||
set state "title"
|
||||
end
|
||||
|
||||
else if test $state = "artist"
|
||||
set song[1] (mpc list albumartist | fuzzel --dmenu || exit)
|
||||
|
||||
set state "album"
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# function select_song
|
||||
# argparse artist=? album=? -- $argv
|
||||
# or return
|
||||
#
|
||||
# if set -ql _flag_artist
|
||||
# select_song --album (mpc list album albumartist $_flag_artist | fuzzel --dmenu || exit)
|
||||
# else if set -ql _flag_album
|
||||
# set title (mpc search --format "%track%\t%title%" album $_flag_album | fuzzel --dmenu || exit)
|
||||
# mpc findadd album $_flag_album
|
||||
# mpc searchplay title $title
|
||||
# else
|
||||
# select_song --artist (mpc list albumartist | fuzzel --dmenu || exit)
|
||||
# end
|
||||
# end
|
||||
|
||||
function select_song_from_queue
|
||||
set title (mpc playlist --format "%artist%\t%title%" | fuzzel --dmenu --select=(mpc current --format "%artist%\t%title%") --accept-nth 2 || exit)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue