shell/fzf: add bin/fzf-mpc

This commit is contained in:
Henrik Lissner 2017-04-25 02:42:11 -04:00
parent b87063b27e
commit 28ed7298a7

6
shell/fzf/bin/fzf-mpc Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
song_position=$(mpc -f "%position%) %artist% - %title%" playlist | \
gui-fzf --query="$1" --select-1 --exit-0 | \
sed -n 's/^\([0-9]\+\)).*/\1/p') || return 1
[[ -n "$song_position" ]] && mpc -q play "$song_position"