I've wanted to have a terminal based music player in LINUX for a while, and actually got it set up earlier this year but failed to document how quickly enough before I forgot all the steps. Now that I've set it up again I wanted to make sure I didn't forget it for the next time I have to go through all of this. The original post that started me down this path is here, but unfortunately does not contain enough details on how to get it working, therefore I had to gather my steps from multiple sources.
Step 1 - Install the necessary packages - open a terminal and enter the following command:
|
sudo apt-get install mdp ncmpc
|
Step 2 - Create necessary files and folders by entering the following commands:
|
mkdir ~/.mpd
mkdir ~/.mpd/playlists
sudo cp /etc/mpd.conf ~/.mpd
sudo chown user:user ~/.mpd/mpd.conf #be sure to substitute "user" with your username here
touch ~/.mpd/tag_cache
touch ~/.mpd/mpd.log
gedit ~/.mpd/mpd.conf
|
This last command should open a text editor, scroll through the Files and directories section and change each line from /var/lib/, /var/log/ or /var/run/ to /home/user/ (again subsituting "user" with your username, and if your music files are not located in /home/user/Music correct the path appropriately). Now scroll down to General music daemon properties and place a # in front of user. Lastly, scroll down to Audio Output and remove each # the example of a pulseaudio output, starting with #audio_output { and ending with #}. Save the file and close it. Now type the following commands:
|
sudo /etc/init.d/mpd stop
gksudo gedit /etc/default/mpd
|
Change the line "START_MPD=true" to "START_MPD=false", then save and close the editor. This prevents the daemon from being started as a root application during bootup.
Now, start the daemon as the local user by typing:
Then start the music player client by typing:
Press the 1 key for a list of available commands. Press 3 to access your music library, and press the spacebar on any folder or individual song you would like added to the playlist. Press 2 to view your playlist, and press Enter to start playing music. Press z to toggle shuffle, and r to toggle repeat. Press q to quit.
To save yourself the hassle of starting mpd each time you want to launch the client, you can also add an entry under System > Preferences > Startup Applications so that it loads as you sign in. Because this could interfere with other programs that use audio (video games?) you may not want to set this option.
