#!/bin/sh # This file is maintained at http://git.mdcc.cx/draai # Copyright: © 2021, 2025 Joost van Baal-Ilić # This script is in the public domain. # # running mpd as a user (not as a system daemon) with minimal configuration, # and starting draai # # alternatively, one can achieve this using systemd. # see also /usr/share/doc/mpd/README.Debian. # # FIXME # exit with error in case mpd.conf does not define an audio_output like: # # cat <>/etc/mpd.conf # audio_output { # type "pulse" # name "My Pulse Output" # } # EOT if test ! -e $HOME/.mpdconf then if grep -v '^#' /etc/mpd.conf | grep user then cat >&2 <&2 dr_init: warning: chmod-ing /var/lib/mpd and /run/mpd/ test -w /var/lib/mpd || sudo chmod g+w /var/lib/mpd for f in state sticker.sql tag_cache do test -w /var/lib/mpd/$f || rm /var/lib/mpd/$f done # FIXME might also want to deal with music/ and playlists/ here sudo chmod g+w /run/mpd/ ( mpd --no-daemon --stderr 2>&1 | logger ) & # hack sleep 2 # joostvb preferences mpc consume mpc crossfade 2 exec draai init