Archive

Archive for the ‘Arch Linux’ Category

Setting up MPD and Ncmpcpp in Arch Linux

December 15, 2009 1 comment

Just to echo Linux.com’s starting line in “CLI audio players for Linux”: What would life be without music? That’s the number 1 thing every self-respecting 21st Century man does in his free time—lip-sync to Britney Spear’s mp3 playing off their computer at eardrum shattering volume. Alsa is also the first thing I install in Arch Linux. Not X, not openssh or anything fancy. Just a good command line audio player with the ability to play mp3, ogg and streaming Internet radio.

Even if you’re running some instance of X like: Gnome, KDE, Xfce or some other window manager, there are reasons why you might want to use a command line audio player even though there are GUI audio players like Audacious, Rhythmbox and Amarok:

  • You cannot or will not install X :D
  • You are using an old computer with limited resource
  • You’re crazy

The last point doesn’t really count as a reason, but I have been trying to learn the Linux command line for the longest time. Even though my 4 year old Toshiba laptop with 1Gb RAM can do Gnome or KDE with relative ease, I’m challenging myself to make my way around Linux using only the command line—for education purposes—not as if I’m such a whiz with an obscure OS like Linux. :p

Ncmpcpp is the frontend for MPD featuring a ncurses TUI(Text User Interface). Instead of typing something like:

archer@oldlappie ~ # mpc search artist 'Lisa Ono' | mpc add
archer@oldlappie ~ # mpc play

You can have something like the image below to easily manage your playlist, browse, add, play, delete and even download lyrics for singing along when your favorite song is playing.

ncmpcpp interface

Lyrics window for your sing-along pleasure:
ncmpcpp lyrics

Even if you’re a little lost when you launch ncmpcpp for the first time, help is just a keystroke away:
ncmpcpp help

MPD has features other than the more obvious ones I’ve listed above. I installed MPD on Arch Linux, so this post contains notes on how I got MPD and ncmpcpp rolling on my chosen distro.

MPD installation notes

1. Installing mpd, mpc and ncmpcpp
2. Configuring mpd
3. Starting mpd and playing from ncmpcpp

1. Installing mpd, mpc and ncmpcpp

Install using Arch Linux’ package manager(pacman) as root:


root@oldlappie ~ $ pacman -S mpd mpc ncmpcpp

That’s it! easy peasy, japaneasy.

2. Configuring mpd

create your mpd directory: /home/[user]/.mpd

archer@oldlappie ~ # mkdir .mpd

Copy mpd.conf.example from /etc to your .mpd directory:

archer@oldlappie ~ # cp /etc/mpd.conf.example .mpd/mpd.conf

Edit /home/[user]/.mpd/mpd.conf using your favorite editor. I’ll be using vim:

archer@oldlappie ~ # vim .mpd/mp.conf

uncomment and make your mpd.conf file reflect as below:


music_directory "/home/[user]/music" # where you store your music
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/mpd.db"
log_file "~/.mpd/mpd.log"
error_file "~/.mpd/mpd.error"
pid_file "~/.mpd/mpd.pid"
state_file "~/.mpd/mpdstate"
user "[user]"

audio_output {
type "alsa"
name "My ALSA Device"
}

Make the ‘playlist’ directory as specified in your mpd.conf:

archer@oldlappie ~ # mkdir .mpd/playlists

That’s about it for configuring mpd for a local user. We’ll have to update mpd’s database before it’ll read, display and play the audio files in your directory.

archer@oldlappie ~ # mpd --create-db

That will start your mpd and you can test if it’s working by adding and playing songs with mpc:

archer@oldlappie ~ # mpc search artist 'Lisa Ono' | mpc add
archer@oldlappie ~ # mpc play
Lisa Ono - I Wish You Love
[playing] #47/62 0:01/3:49 (0%)
volume: 85% repeat: on random: on single: off consume: off
archer@oldlappie ~ #

Ncmpcpp doesn’t require too much configuration, but if you’re going to use ncmpcpp’s in-built tag editor, add your music directory to ‘~/.ncmpcpp/config’.

mpd_music_dir = "/home/[user]/music"

Start ncmpcpp by entering ‘ncmpcpp’ in the command line. That should show you an empty playlist. Top most menu bar will should you the different mode ncmpcpp is capable of. If you’re unsure of the key-bindings in ncmpcpp, hit F1 or ’1′ to get into help page. Minimal commands you should know.


        Up k        : Move Cursor up
        Down j      : Move Cursor down
        Page Up     : Page up
        Page Down   : Page down
        Home        : Home
        End         : End

        Tab         : Switch between playlist and browser
        1 F1        : Help screen
        2 F2        : Playlist screen
        3 F3        : Browse screen
        4 F4        : Search engine
        5 F5        : Media library
        6 F6        : Playlist editor
        7 F7        : Tag editor
        0 F10       : Clock screen


   Keys - Global
 -----------------------------------------
        s           : Stop
        P           : Pause
        >           : Next track
        <           : Previous track
        f           : Seek forward
        b           : Seek backward
        Left -      : Decrease volume
        Right +     : Increase volume

        t           : Toggle space mode (select/add)
        T           : Toggle add mode
        |           : Toggle mouse support
        v           : Reverse selection
        V           : Deselect all items
        A           : Add selected items to playlist/m3u file

        r           : Toggle repeat mode
        Z           : Shuffle playlist
        i           : Show song's info
        I           : Show artist's info
        L           : Toggle lyrics database
        l           : Show/hide song's lyrics

        q Q         : Quit


Hope you will enjoy using mpd and ncmpcpp as a low footprint audio player.

Note to Self – Compiling Finch only flags

December 10, 2009 Leave a comment

Compiling Finch without pidgin from source in Arch Linux.

./configure --disable-gtkui --disable-vv --disable-meanwhile --disable-avahi --disable-nm --disable-tcl

Edit: There’s no sound playing from finch. I guess I’ll have to live with it—not a big problem.

Posting AsciiDocs with blogpost 0.9.1 to WordPress

August 16, 2008 Leave a comment

This is my first time using AsciiDocs to write a blog post. The irony is that I have to learn how to config and post from the command line using: Blogpost 0.9.1. Blogpost 0.9.1 was created by Stuart Rackham. After creating docs, manpage with Asciidoc, he found the need to submit a asciidoc text file to his chosen blogging platform—Wordpress. That’s when he started writing Blogpost, all so that he could create a .txt file with ascii syntax and post it to his blog from the command line.

In any case, I’m just going to try out for this once.

Categories: Arch Linux, Linux

Using Arch Linux – package management with pacman

August 12, 2008 Leave a comment

One of the reason why I use Arch Linux is for it’s package management system–pacman. A simple to use package manager, even though it does not have a GUI. Every upgrade, installation of new packages, updates is done from the console. I’ll be showing the few commands I use when installing, updating, upgrading my system.

# pacman -Syu

This simple command, syncs with the respositories and checks for updates to your system. If there are upgrades to be had, it will prompt you after synchronizing with the remote server.

# pacman -Ss name_of_package

Searches database for package with specified string in it’s title or description. This is good if you’re searching for a package you’re not sure exists in the database.

# pacman -Sy name_of_package

This command installs a package.

# pacman -Scc

Removes the cache from your system.

# pacman -Rs name_of_package

Uninstalls package and it’s dependencies.

# pacman -Qtd

Searches for orphaned packages no longer needed. After which, it asks if user would want to uninstall the packages.

These are the very few common pacman commands I use in Arch Linux. With these few commands, you can keep your system up to date.

Categories: Arch Linux, Linux
Follow

Get every new post delivered to your Inbox.