You are on page 1of 3

Customizing MOC to Perfection @

JWC.blog
Every month, I take a screenshot of my desktop and post it to the Arch Linux
forums.

I included a shot of my music player of choice, MOC, in the background.  But


after looking at it for a few seconds, I realized that I have spent months using
this music player without giving it a proper color theme (looks really ugly,
doesn’t it?).  Furthermore, the default keymap for MOC isn’t very Vim-
friendly.

So, after a little work, I achieved some nice results.  First of all, I remapped a
bunch of keys to make things a bit more comfortable for Vim users like
myself.  Then, I set to work building a nice theme that would work well with
my particular terminal colors (MOC only supports the 8 terminal colors).  The
result is this:

Perhaps others might find my configuration useful.  So, I’ve included the
config files below.  First of all, I should note that my terminal colors do not
support the “standard notion” of what they should be, primarily because I
chose to get rid of “cyan” and make that color a dark bluish color.  The
terminal colors are almost identical to the dante.vim Vim colorscheme, a
theme I encountered a while back (I’m currently using a modified version of
lucius.vim as my colorscheme, but it is very similar).  Here they are:
Color Regular Intense
------------------------
Black: #1B1D1E #343737
Red: #F92673 #FF5996
Green: #86B413 #B8E354
Yellow: #FDB436 #FEED6A
Blue: #55C5D6 #8CEEFF
Magenta: #8952FE #9C6EFE
Teal: #465457 #899CA1
Gray: #CCCCC7 #FFFFFF

Foreground: #FFFFFF
Background: #000000 (semi-transparent)

Here’s a quick table showing the resulting colors:

Colorscheme and Keymap

If you have similar kinds of colors, you might be interested in the MOC
theme.  Download the following file and drop it in ~/.moc/themes.  Then, you
can also added into your config file as the default theme.

http://jwcxz.com/other/mocp/dante

And, here is the Vim-like keymap:

http://jwcxz.com/other/mocp/keymap

You can just drop this file in ~/.moc and then edit your config file to use this
keymap file.

Global Keyboard Shortcuts and Remote Status Display

I chose MOC over MPD because of its nice lightweight footprint and tidy
environment.  MOC actually supports remote operations so you can easily
bind your keyboard’s media keys so that they control the player.  I also want
to be able to display the current song and progress in my Conky setup (see
screenshot).  It turns out that this is also pretty easy.  I have been using the
following configuration for a while now:

First, to control MOC, I bound these commands to my media keys:


Play/Pause: [[ -z $(pidof mocp) ]] || mocp -G
Stop: [[ -z $(pidof mocp) ]] || mocp -s
Next Track: [[ -z $(pidof mocp) ]] || mocp -f
Prev Track: [[ -z $(pidof mocp) ]] || mocp -r

And to display the current song information, I used the following lines in my
.conkyrc
${if_running mocp}${alignc}${execi 10 mocp -Q '%song\n%artist\n%album'}
${execbar mocp -Q '%cs/%ts*100' | bc -l}${endif}

This will display the song, artist, and album each on their own lines.  Below
that, it will display a progress bar.

You might also like