feat: simple music player

This commit is contained in:
Viktor Varland 2023-05-09 08:04:58 +02:00
commit 72a57489ea
Signed by: varl
GPG key ID: 7459F0B410115EE8
2 changed files with 47 additions and 0 deletions

22
README.md Normal file
View file

@ -0,0 +1,22 @@
# `mp`
A very simple music player interface that uses `fzf` as an interface to
`mpc`.
## Requirements
- MPD + mpc
- fzf
## Bindings
|Shortcut|Description|
|---|---|
|ctrl-j|Move down a row|
|ctrl-k|Move up a row|
|ctrl-l|Move into selection (albums)|
|ctrl-h|Move up to top (artist)|
|ctrl-u|Update the mpd database|
|ctrl-space|Toggle play/pause|
|enter|Clear the queue and add the selection, and play it|

25
mp Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env zsh
#
## music player with fzf+mpc
#
function mp {
FZF_DEFAULT_COMMAND="mpc ls" \
fzf \
--bind 'ctrl-h:reload( \
eval "$FZF_DEFAULT_COMMAND"
)' \
--bind "ctrl-l:reload( \
mpc ls {}
)" \
--bind 'enter:execute-silent( \
mpc clear && mpc add {} && mpc play \
)' \
--bind 'ctrl-u:execute-silent( \
mpc update
)' \
--bind 'ctrl-space:execute-silent(mpc toggle)' \
--preview 'mpc ls {}'
}
mp