Write the mpd.conf file by means of a shell script

This commit is contained in:
Gerard Vermeulen 2022-04-23 16:50:56 +02:00
parent 322ee48f42
commit f2c2f6aa10

View File

@ -3547,7 +3547,8 @@ Listing [[lst:configure-elfeed]] configures =elfeed=.
The link [[https://sqrtminusone.xyz/posts/2021-09-07-emms/][my emms and elfeed setup]] is a nice introduction to configuring and
using =emms= with =elfeed=. Listing [[lst:configure-emms]] configures =emms= for
use with =elfeed=.
use with =elfeed= and listing [[lst:write-mpd-conf]] writes a configuration file for
the [[https://www.musicpd.org/][Music Player Daemon]].
#+caption[Configure =emms=]:
#+caption: Configure =emms=.
@ -3591,10 +3592,13 @@ use with =elfeed=.
(emms-all))
#+end_src
#+caption[Configure =mpd= on =Darwin=]:
#+caption: Configure =mpd= on =Darwin=.
#+name: lst:configure-mpd-darwin
#+begin_src conf :tangle (when (eq system-type 'darwin) "~/.mpd/mpd.conf")
#+caption[Write =mpd.conf=]:
#+caption: Write =mpd.conf=.
#+name: lst:write-mpd-conf
#+begin_src shell :results silent
case "$(uname -s)" in
Darwin)
cat <<EOF > ~/.mpd/mpd.conf
music_directory "~/Music"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/mpd.db"
@ -3610,11 +3614,14 @@ use with =elfeed=.
mixer_type "software"
}
bind_to_address "127.0.0.1"
bind_to_address "localhost"
connection_timeout "86400"
port "6600"
user "vermeulen"
user "$USER"
EOF
;;
esac
#+end_src
* [[info:emacs#Init File][Init File (info)]] footer