helm/shell/fzf/bin/fzf-mpc

7 lines
246 B
Plaintext
Raw Normal View History

2017-04-24 23:42:11 -07:00
#!/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"