2017-12-05 22:39:10 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
#
|
|
|
|
# Select and play a song from the current playlist (using fzf)
|
|
|
|
#
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
song=$(mpc -f "%position%) %artist% - %title%" playlist)
|
|
|
|
song_index=$(fzf --query="$1" --select-1 --exit-0 --prompt='play > ' <<<"$song" | sed -n 's/^\([0-9]\+\)).*/\1/p')
|
2017-12-31 22:33:49 -08:00
|
|
|
[[ -n $song_index ]] && mpc -q play "$song_index"
|