Topic: Little MOC how-to
As suggested I will make here a little MOC how-to if someone is interested and does not have the time to hunt for it.
I think all #!'ers know what MOC is. In reality it is really easy to set up, the problem is that the infos on the home page are somehow old/outdated. So I will take the time to write my little how-to. Bear with me, it is my first one. ![]()
First of all, I really like this little CLI music program, it does everything you want, and more important it has out of the box gapless playback, you can use an EQ and you can set up also LastFM. The most used codecs are supported, just Ape does not work but maybe in the future. The app is still under development not as active but many users contribute patches etc.
I will speak of the actual MOC version from the Debian Testing repositories as I am on Wheezy, not sure if some patches are not working yet from the Stable repository.
First of all we will install the app with of course:
apt-get install mocThen we will also install if needed the ffmpeg plugin:
apt-get install moc-ffmpeg-pluginTo configure MOC properly or to your likings we will need a MOC config, first start MOC with the command:
mocpNow you can pull the config into your home folder with:
cd ~/.moc && cp /usr/share/doc/moc/examples/config.example.gz ./ && gunzip config.example.gz && mv config.example config Now we can begin to edit the config file with your preferred text editor.
You can see already some things you can change but I will speak about the most important.
First of all, if you want that MOC starts with your music directory you have to go to this section:
#MusicDir = "/home/joe/music"and change it with your music path, in my case as an example as my music is on an external drive:
MusicDir = "/media/David Extern/Música"Now change this line to look like this:
StartInMusicDir = yesNow when you start MOC it will open straight into your music directory of choice, with the keystroke m you can always go directly back to your music directory.
With q you can close MOC, open it again and it should be set up with your music directory. With Q you can also shutting down the whole service, as MOC runs also as a server.
With T
you can select some default themes, I prefer to use another one. That is also easy, just create a /themes folder in your /.moc directory, choose a text editor and create a file. I went the easy path and decided to take the theme of @rhowaldt as it fits well with my Xfce Greybird theme:
# Thank you Gutterslob & pvsage from #! forums!
# Example color theme for MOC.
# You can use a theme by copying it to ~/.moc/themes directory and using
# Theme config option or -T command line option.
#
# Fill free to make your own themes and send me them. It will be included in
# official MOC releases or on the MOC web site.
#
# The format of this file is:
# Lines beginning with # are comments.
# Blank lines are ignored.
# Every other line is expected to be in format:
#
# ELEMENT = FOREGROUND_COLOR BACKGROUND_COLOR [ATTRIBUTE[,ATTRIBUTE,..]]
#
# or
#
# colordef COLOR = RED GREEN BLUE
#
# Where names are case insensitive.
#
# ELEMENT is an element of MOC interface. This can be:
# background - default background for regions when nothing is displayed
# frame - frames for windows
# window_title - the title of the window (eg name of the current
# directory)
# directory - a directory in the menu
# selected_directory - a directory that is selected using arrows
# playlist - playlist file
# selected_playlist - see selected directory
# file - an ordinary file in the menu (mp3, ogg, ...)
# selected_file - see selected directory
# marked_file - a file that is currently being played
# marked_selected_file - a file that is currently being played and is also
# selected using arrows
# info - information shown at the right side of files
# selected_info - see selected directory
# marked_info - a file (its time) that is currently being played
# marked_selected_info - a file (its time) that is currently being played
# and is also selected using arrows
# status - the status line with a message
# title - the title of the file that is currently being played
# state - the state: play, stop, or paused (>, [], ||)
# current_time - current time of playing
# time_left - the time left to the end of playing the current file
# total_time - the length of the currently played file
# time_total_frames - the brackets outside the total time of a file ([10:13])
# sound_parameters - the frequency and bitrate numbers
# legend - "KHz" and "Kbps"
# disabled - disabled element ([STEREO])
# enabled - enabled element
# empty_mixer_bar - "empty" part of the volume bar
# filled_mixer_bar - "filled" part of the volume bar
# empty_time_bar - "empty" part of the time bar
# filled_time_bar - "filled" part of the time bar
# entry - place wher user can type a search query or a file name
# entry_title - the title of an entry
# error - error message
# message - information message
# plist_time - total time of displayed items
#
# FOREGOUND_COLOR and BACKGROUND_COLOR can have one of the following values:
# black, red, green, yellow, blue, magenta, cyan, white, default (can be
# transparent), grey (not standard, but works)
#
# Optional ATTRIBUTE parameters can be (from ncurses manual):
# normal - default (no highlight)
# standout - best highlighting mode of the terminal
# underline - underlining
# reverse - reverse video
# blink - blinking
# dim - half bright
# bold - extra bright or bold
# protect - protected mode
#
# You can specify a list of attributes separated by commas: attr1,attr2,attr3.
# Don't use spaces anywhere in such a list.
#
# With colordef you can change the definition of a color. It works only if
# your terminal supports it, if not those lines will be silently ignored.
# COLOR must be a valid color name and the RED GREEN and BLUE are numbers
# from 0 to 1000. Example:
#
# colordef red = 1000 0 0
#
# HINT: you have only 8 colors, but combined with attributes bold and/or
# reversed you actually get more colors.
#
# If you don't specify some elements, the default values will be used.
#
# Replaces the default configuration:
background = default default
frame = default default
window_title = default default
directory = blue default
selected_directory = blue default reverse
playlist = default default
selected_playlist = default default reverse
file = default default
selected_file = default default reverse
marked_file = blue default bold
marked_selected_file = blue default reverse
info = default default
selected_info = default default
marked_info = blue default bold
marked_selected_info = blue default bold
status = default default
title = blue default bold
state = default default
current_time = default default
time_left = default default
total_time = default default
time_total_frames = default default
sound_parameters = default default
legend = default default
disabled = default default
enabled = blue default bold
empty_mixer_bar = default default
filled_mixer_bar = default default reverse
empty_time_bar = default default
filled_time_bar = default default reverse
entry = default default
entry_title = default default
error = default default bold
message = default default bold
plist_time = default defaultI named it blue_theme. Now it will show up in the themes selection of MOC and you can use it. You need to change again this line:
# Theme = example_themewith your theme of choice and with the next start of MOC it will use your theme. You can also change the line for Xterm there.
As I am a LastFM fan I needed also this. MOC does not have LastFM build in by default, there are also some patches but I prefer the easy way. Just install lastfmsubmitd with:
apt-get install lastfmsubmitdand follow the instructions, you will be asked to set up your account. To make it work with MOC, we have again to edit the config. You have to go to this line and make it look like mine:
OnSongChange = "/usr/lib/lastfmsubmitd/lastfmsubmit --artist %a --title %t --length %d --album %b"Restart MOC and now it will scrobble your tracks, not as nice, as it will scrobble them immediately and not after 50 % of the played time e.g. but it works.
The last thing for me to do was to add an EQ. The sound is not bad but I need the possibilty to manipulate it.
Create a folder and name it e.g. eqsets. Now grab some presets from here, they are from Winamp: http://moc.daper.net/node/397. Put them in your EQ folder, with E
you can enable/disable the EQ, with k you can switch through the different EQ presets. You can even make your own.
I think that's it. If you want more on MOC, just press h and it will give you all the keystrokes or look at the documentation on their site for more things. I hope you have fun with MOC.
And here a screenshot how mine looks:
For more themes of our community look at this thread: http://crunchbanglinux.org/forums/topic gs-themes/.
Ah, before I forget, a nice feature is the ability to search in your directories. With g you will be prompted to a text search, just if you would use a library based audio player. Nice thing. ![]()
Thanks go to @rhowaldt for the awesome theme, to @Slobby who gave me tips on the EQ and to @VastOne who also helped me to find some things.
Note: When setting up LastFM, it will ask you which group to use, put there audio.
Edit: If you want to use conky with MOC, then go here.
Edit (Nov. 16 2011): I must read something wrong, there is actually no cue sheet support. Tried it, did not work. Fixed that in the how-to.
Last edited by ivanovnegro (2011-11-16 06:35:38)


