shell/fzf: add bin/fzf-mpc
This commit is contained in:
parent
b87063b27e
commit
28ed7298a7
6
shell/fzf/bin/fzf-mpc
Executable file
6
shell/fzf/bin/fzf-mpc
Executable 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"
|
Loading…
Reference in a new issue