Phundrak's Dotfiles
Source
Source
  • Index
  • About this website
  • Emacs
    • Basic Configuration
    • Custom Elisp
    • Package Manager
    • Keybinding Managers
    • Autocompletion
    • Applications
    • Editing
    • Emacs built-ins
    • Making my life easier
    • LaTeX
    • Org-mode
    • Programming
    • Visual Configuration
    • Misc
    • Keybindings
  • Custom Scripts
  • Desktop
  • General Shell Configuration
  • Fish
  • Git
  • Hyprland
  • MPD
  • Neofetch
  • Picom
  • StumpWM
    • Basic Configuration
    • Colours
    • Mode-Line
    • Groups and Placement
    • Theme
    • Commands
    • Keybindings
    • Utilities
  • Tmux
  • Deprecated Configs
    • AwesomeWM
    • Bootstrap Script
    • i3
    • Nano
    • Polybar
    • Spacemacs

MPD

As its name indicates, the Music Player Daemon — or MPD for short — is a daemon that manages music files on a computer and plays them. It can be manipulated by various front-end applications, such as the command-line utility mpc, TUI ncmpcpp, or GUI cantata. In my case, I use mainly ncmpcpp and Emacs’ EMMS.

On my computer, MPD runs as a user daemon.

Required Parameters

MPD requires a few compulsory parameters that we will see below.

Parameter nameValueComment
follow_outside_symlinksyesWhether to follow symlinks pointing outside the music directory
follow_inside_symlinksyesWhether to follow symlinks pointing inside the music directory
db_file~/.config/mpd/databaseLocation of MPD’s database
sticker_file~/.config/mpd/sticker.sqlLocation of the sticker database (dynamic information attached to songs)
log_file~/.config/mpd/logLocation of MPD’s log file
follow_outside_symlinks "yes"
follow_inside_symlinks "yes"
db_file "~/.config/mpd/database"
sticker_file "~/.config/mpd/sticker.sql"
log_file "~/.config/mpd/log"

Optional Parameters

While these values are not strictly necessary, some are still useful such as music_directory: we don’t have to manually add our music to MPD each time we run it.

ParameterValueComment
music_directory~/MusicLocation of the music directory
playlist_directory~/Music/playlistsLocation of MPD playlists
pid_file~/.config/mpd/pidLocation of MPD’s PID
state_file~/.config/mpd/stateFile where the state of MPD is saved when killed
bind_to_addresslocalhostLimit MPD to the localhost address
auto_updateyesNo need to manually update MPD’s database with mpc update
music_directory "~/Music"
playlist_directory "~/Music/playlists"
pid_file "~/.config/mpd/pid"
state_file "~/.config/mpd/state"
bind_to_address "localhost"
auto_update "yes"

Audio outputs

Two audio outputs will be defined. The first one sets Pulseaudio up, so I can actually hear my music. Its configuration is simple, really.

audio_output {
  type  "pulse"
  name  "pulse audio"
}

Another one sets up the visualizer of ncmpcpp. It is not necessary to create this one if you don’t plan on using this feature.

audio_output {
  type "fifo"
  name "my_fifo"
  path "/tmp/mpd.fifo"
  format "44100:16:2"
}
Prev
Hyprland
Next
Neofetch