rework mpd stuff

This commit is contained in:
Never Gude 2026-07-27 21:49:54 +02:00
parent 86ac629695
commit be83022964
2 changed files with 20 additions and 12 deletions

View file

@ -9,8 +9,8 @@ function open_semester
alacritty msg create-window --working-directory $argv[1]
else if test -d $argv[1]/$input
open_semester $argv[1]/$input
else if test (xdg-mime query filetype $argv[1]/$input) = "application/pdf" && test (menu "PDF" "Ipe") = "Ipe"
ipe $argv[1]/$input
# else if test (xdg-mime query filetype $argv[1]/$input) = "application/pdf" && test (menu "PDF" "Ipe") = "Ipe"
# ipe $argv[1]/$input
else
xdg-open $argv[1]/$input
end
@ -52,21 +52,29 @@ function select_song
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 song[3] (echo -e "\t.\n\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 ""
mpc find album $song[2] | mpc insert
mpc next
else if test $song[3] = ".."
set state "album"
else
set state ""
mpc findadd album $song[2]
mpc searchplay title $song[3]
mpc find album $song[2] | mpc insert
mpc play (math (mpc current --format "%position%") + (mpc search --format "%track%" 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)
set song[2] (echo -e ".\n..\n$(mpc list album albumartist $song[1])" | fuzzel --dmenu || exit)
if test $song[2] = ".."
if test $song[2] = "."
set state ""
mpc find albumartist $song[1] | mpc insert
mpc next
else if test $song[2] = ".."
set state "artist"
else
set state "title"
@ -83,9 +91,9 @@ function select_song
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)
set title (mpc playlist --format "%artist%\t%album%\t%title%" | column --table --separator \t --output-separator \t | fuzzel --dmenu --index --width 80 --lines 24 --select-index=(math (mpc current --format "%position%") - 1) --accept-nth 3 || exit)
mpc searchplay $title
mpc play (math $title + 1)
end
# Select the default audio source