bin/fmpc: select mpd song via fzf

This commit is contained in:
xeruf 2021-10-15 13:44:15 +02:00
parent f614e22a06
commit 096a242fbc
1 changed files with 7 additions and 0 deletions

7
.local/bin/scripts/fmpc Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# Select a song in the mpd queue using fzf and mpc
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