Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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