Setting up mpd and mpc to use with dmenu and i3 on Arch Linux

Posted by jason on May 11, 2012, 5:46 p.m.
Tags: arch i3
  1. Install mpd and mpc:
    [jason@jason ~]$ pacman -S mpd mpc
  2. I copied the /usr/share/mpd/mpd.conf.example file to /etc/mpd.conf and bent it to my will. Here's what it looks like:
    [jason@jason ~]$ cat /etc/mpd.conf
    music_directory		"/var/lib/mpd/music"
    playlist_directory "/var/lib/mpd/playlists"
    db_file "/var/lib/mpd/mpd.db"
    pid_file "/run/mpd/mpd.pid"
    state_file "/var/lib/mpd/mpdstate"
    user "mpd"
    input {
            plugin "curl"
    }
    audio_output {
    	type		"alsa"
    	name		"My ALSA Device"
    	mixer_type      "software"
    }
  3. Create the music directory and make sure mpd is the owner:
    [jason@jason ~]$ sudo mkdir /var/lib/mpd/music
    [jason@jason ~]$ sudo chown mpd:mpd /var/lib/mpd/music
  4. I don't actually keep my music files in /var/lib/mpd/music, so I bind that directory to the real one:
    [jason@jason ~]$ sudo echo "/home/jason/mp3 /var/lib/mpd/music none bind" >> /etc/fstab
    [jason@jason ~]$ sudo mount -a
    
  5. You can start the mpd daemon now, and add it to your DAEMONS array in rc.conf if you like:
    [jason@jason ~]$ sudo /etc/rc.d/mpd start

Now that we have the mpd daemon set up and running, you can have fun with mpc and dmenu. See the dmenu hacking thread from the Arch forums for some cool ideas.


0 comments