helm/shell/fzf/bin/fzf-mpc
2017-04-25 02:42:11 -04:00

7 lines
246 B
Bash
Executable file

#!/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"