#+TITLE: Print currently playing MPD's song metadata and status as JSON
# #+PROPERTY: header-args :comments org
#+OPTIONS: toc:1
* Installation
: cabal install mpd-current-json
or
#+begin_example
git clone https://codeberg.org/useless-utils/mpd-current-json
cd mpd-current-json
#+end_example
and to install the executable to =./dist=, in the current directory:
: cabal install --install-method=copy --overwrite-policy=always --installdir=dist
or to install to =${CABAL_DIR}/bin= remove the =--installdir=dist=
argument. =CABAL_DIR= defaults to =~/.local/share/cabal=.
* Usage
get values
: mpd-current-json | jaq .tags.album
: mpd-current-json | jaq .status.elapsed_percent
provide host and port with
: mpd-current-json -h 'localhost' -p 4321