Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@johand
Created March 28, 2016 05:01
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save johand/66b4c229447c2d879f0d to your computer and use it in GitHub Desktop.
Save johand/66b4c229447c2d879f0d to your computer and use it in GitHub Desktop.
mpd + ncmpcpp + pulseaudio with systemd in archlinux

Installation

pacman -S mpd ncmpcpp

MPD

copy the example configuration in mpd.conf

# cp /usr/share/doc/mpd/mpdconf.example /etc/mpd.conf

create mpd directory mkdir ~/.mpd and their files

touch ~/.mpd/mpd.db
touch ~/.mpd/mpd.log
touch ~/.mpd/mpd.pid

open mpd.conf and configure

music_directory      "~/path_to_music"
db_file              "~/.mpd/mpd.db"
log_file             "~/.mpd/mpd.log"
pid_file             "~/.mpd/mpd.pid"
user                 "your user"
bind_to_address      "any"
port                 "6600"
auto_update          "yes"

audio_output {
        type         "pulse"
        name         "My Pulse Output"
        server       "127.0.0.1"
}

filesystem_charset   "UTF-8"

uncomment the line load-module module-native-protocol-tcp in /etc/pulse/default.pa and set the ip 127.0.0.1

load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1

restart pulseaudio

add server 127.0.0.1 to the audio_output in mpd.conf

audio_output {
        type         "pulse"
        name         "My Pulse Output"
        server       "127.0.0.1"
}

create user.conf file in /etc/systemd/system/mpd.service.d/ and set your user

[Service]
User=foo

Ncmpcpp

copy the example configuration

$ cp /usr/share/doc/ncmpcpp/config ~/.ncmpcpp/config

open the conf file and configure

mpd_music_dir =       "~/path_to_music"
display_bitrate =     "yes"

enable and start mpd

# systemctl enable mpd.service
# systemctl start mpd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment