Custom mpd client thingy

This commit is contained in:
~erin 2023-03-17 12:02:33 -04:00
parent f2c6eebc1c
commit 4611f6d90d
1 changed files with 29 additions and 0 deletions

29
functions/music.fish Normal file
View File

@ -0,0 +1,29 @@
function music
argparse h/help c/client -- $argv
or return
if set -ql _flag_help
echo "music [-h|--help] [-c/--client]"
return 0
end
if set -ql _flag_client
ncmpcpp
end
set -f path (mpc -f %file% | sed -E '1 s:^(.+)\\/([^\\/]+)$:\1:' | head -n 1 | tr -d "\n")
set cover (fd -e png -e jpg . "$HOME/Music/$path/")
chafa --size=100x100 $cover
mpc -f "%artist%@%album%@%title%" | head -n 1 | read -d @ -l artist album song
echo ""
set_color red
echo -n $artist
set_color white
echo -n " - "
set_color cyan
echo -n $album
set_color white
echo -n " - "
set_color green
echo $song
end