dotfiles/.local/bin/scripts/fmpc

9 lines
313 B
Bash
Executable File

#!/bin/sh -e
# Select a song in the mpd queue using fzf and mpc
# depends: fzy/fzf-tmux mpc
song_position=$(mpc -f "%position%) %artist% - %title%" playlist |
#fzy --query="$1" |
fzf-tmux --query="$1" --reverse --exit-0 |
sed -n 's/^\([0-9]\+\)).*/\1/p')
test -n "$song_position" && mpc play $song_position