mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 16:45:38 -05:00
Add another example: play mpd songs with mpc + fzf
14
Examples.md
14
Examples.md
@@ -513,6 +513,20 @@ zle -N fzf-locate-widget
|
||||
bindkey '\ei' fzf-locate-widget
|
||||
```
|
||||
|
||||
### mpd
|
||||
|
||||
You must have [`mpc`](http://www.musicpd.org/clients/mpc/) installed on your computer in order to use this function.
|
||||
|
||||
```sh
|
||||
fmpc() {
|
||||
local song_position
|
||||
song_position=$(mpc -f "%position%) %artist% - %title%" playlist | \
|
||||
fzf-tmux --query="$1" --reverse --select-1 --exit-0 | \
|
||||
sed -n 's/^\([0-9]\+\)).*/\1/p') || return 1
|
||||
[ -n "$song_position" ] && mpc -q play $song_position
|
||||
}
|
||||
```
|
||||
|
||||
### Readline
|
||||
|
||||
```sh
|
||||
|
||||
Reference in New Issue
Block a user