Powered By

Powered by Blogger

Tampilkan postingan dengan label Ncmpcpp. Tampilkan semua postingan
Tampilkan postingan dengan label Ncmpcpp. Tampilkan semua postingan

Sabtu, 06 Februari 2010

Fix MPD From Git Local Connection

I'm using MPD and GMPC both from GIT (not compiling them, but using the Launchpad PPA which has daily builds) and some recent updates resulted in an error:
socket(): Address family not supported by protocol

Which apparently has something to do with IPv6, and this error resulted in not allowing any MPD client to connect to MPD (I've tried GMPC, Sonata, NCMPCPP).

I couldn't find an actual fix for this, but a work-around which allows local clients to connect to MPD.

Here's what I did (this will hopefully help others having the same issue) to get GMPC/Sonata/NCMPCPP/etc to connect to MPD again. Open a terminal and:

sudo gedit /etc/mpd.conf
and scroll down to:
bind_to_address "localhost"
and comment this line (add a "#" in front of it - without the quotes)
Under that line, you should have this:
#bind_to_address "/var/run/mpd/socket"

Uncomment this line (remove the "#"). Then save the file.

Now, to get any MPD client to connect again, edit its config file and replace "localhost" with "/var/run/mpd/socket"

-For GMPC: open it, go to Music > Preferences, on the "Connection" tab, under "Host", enter:
/var/run/mpd/socket

-For NCMPCPP: if you already have created the .ncmpcpp directory in your home folder, skip the first command:
sudo mkdir ~/.ncmpcpp
sudo gedit ~/.ncmpcpp/config

If you already have a "mpd_host" line, replace "localhost" with "/var/run/mpd/socket". If not, add this line:
mpd_host = "/var/run/mpd/socket"

You can comment the port line.

If you use a different MPD client, search its config file and follow the steps above.

Minggu, 03 Januari 2010

Ncmpcpp: Ncurses MPD Client [Shell Music Player - Linux]

For a shell music player, I used to love CMus (I still like it a lot), but I've found a similar - probably better - command line music player which is actually a MPD client: Ncmpcpp.

Ncmpcpp (Ncmpc++) is an ncurses MPD client inspired by Ncmpc (runs in a terminal). Ncmpcpp has an UI very similar to ncmpc's one, but it provides new useful features such as support for regular expressions in search engine, extended song format, items filtering, fetching artist's info from last.fm, tag editor, ability to sort playlist, local filesystem browser, song lyrics and other minor functions.


Ncmpcpp mpdNcmpcpp mpdncmpcpp mpd playlist



Why use Ncmpcpp (Ncmpc++)?


  • It's fast and uses very few system resources. On my computer, it uses 2,2 MB of RAM - on a music database of ~40.000 songs.
  • It has all the features you may want in a music player, even Last.fm info, lyrics, multiple views and tag editor.
  • Very easy to use - must remember a few keyboard shortcuts.
  • Ncmpcpp can basically run and work perfect on any PC, no matter it's configuration.
  • Want to look geeky in front of your friends =)



Install Ncmpcpp


Ubuntu

The version available in the repositories is very old. To install the latest Ncmpcpp in Ubuntu, add the following PPA:

-Ubuntu Karmic:
sudo add-apt-repository ppa:aguignard/ppa

-Ubuntu Jaunty or Intrepid (however, the Jaunty and Intrepid version is old):
sudo sh -c "echo 'deb http://ppa.launchpad.net/aguignard/ppa/ubuntu YOUR_UBUNTU_VERSION_HERE main' >> /etc/apt/sources.list"
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 9058FBF6

Replacing "YOUR_UBUNTU_VERSION_HERE" with jaunty or intrepid.

Then, install Ncmpcpp (any Ubuntu version):
sudo apt-get update && sudo apt-get install ncmpcpp


For other Linux distributions, see Ncmpcpp downloads page.


Configure Ncmpcpp


Firstly, you must configure MPD. If you haven't done this already, see our Sonata + MPD article - we covered setting up MPD in that post. If you want to install the latest version of MPD in Ubuntu, see our Gnome Music Player Client (GMPC) + MPD article (see the MPD PPA installation part).

OK, once you have MPD set up and installed Ncmpcpp, let's create a config file.

Ncmpcpp doesn't require too much configuration, but you can configure it's colors and so on if you want. Don't worry, I have found some really interesting Ncmpcpp configuration files and you can try those or create your own. One thing you have to do (if you want to use the built-in tag editor) is set your music directory in the Ncmpcpp config file.

Let's proceed. Run the following 2 commands in a terminal:
mkdir ~/.ncmpcpp
gedit ~/.ncmpcpp/config
This is the config file I am using (to use it yourself, simply paste it in the newly opened ~/.ncmpcpp/config file):

##### connection settings #####
mpd_host = "localhost"
mpd_port = "6600"
mpd_music_dir = "/path/to/your/music/directory"
mpd_connection_timeout = "5"
mpd_crossfade_time = "5"

##### delays #####
playlist_disable_highlight_delay = "5"
message_delay_time = "4"

##### song format #####
song_list_format = "{%a - %t}|{$8%f$9}%r{$3(%l)$9}"
song_library_format = "{%n - }{%t}|{%f}"
media_library_album_format = "{(%y) }%b"
tag_editor_album_format = "{(%y) }%b"
browser_playlist_prefix = "$2playlist$9 "
selected_item_prefix = "$6"
selected_item_suffix = "$9"
song_status_format = "{(%l) }{%a - }{%t}|{%f}"
song_window_title_format = "{%a - }{%t}|{%f}"
song_columns_list_format = "(5)[magenta]{l} (28)[cyan]{a} (30)[blue]{b} (50)[white]{t}"
alternative_header_first_line_format = "{%t}"
alternative_header_second_line_format = "$7{%a} - $5{%b} $8{(%y)}"

##### various settings #####
playlist_display_mode = "columns"
incremental_seeking = "yes"
seek_time = "1"
autocenter_mode = "yes"
repeat_one_mode = "no"
default_place_to_search_in = "database"
media_library_left_column = "a"
default_find_mode = "wrapped"
default_space_mode = "add"
default_tag_editor_left_col = "albums"
default_tag_editor_pattern = "%n - %t"
header_visibility = "yes"
header_text_scrolling = "yes"
cyclic_scrolling = "yes"
statusbar_visibility = "yes"
fancy_scrolling = "yes"
follow_now_playing_lyrics = "no"
ncmpc_like_songs_adding = "yes"
display_screens_numbers_on_start = "yes"
clock_display_seconds = "yes"
enable_window_title = "yes"
user_interface = "alternative"
progressbar_look = "-)"


##### colors definitions #####
colors_enabled = "yes"
empty_tag_color = "cyan"
header_window_color = "default"
volume_color = "default"
state_line_color = "default"
state_flags_color = "default"
main_window_color = "cyan"
color1 = "white"
color2 = "green"
main_window_highlight_color = "blue"
progressbar_color = "default"
statusbar_color = "default"
active_column_color = "red"
window_border_color = "green"
active_window_border = "red"
alternative_ui_separator_color = "black"


Edit the path to your music folder on top of the file, then save it. This configuration was created by Barrucadu user @ ArchLinux forums.

You can find more configuration files with screenshots @ ArchLinux forums.

To run Ncmpcpp, simply type ncmpcpp in a terminal.

To navigate through the different Ncmpcpp views, use 1-9 keys (or F1-F9). But to get you started, read the help (pressing "1" or F1).