# Moc

Music On Console is a lightweight music player which consists of 2 parts, a server (Moc) and a player/interface (Mocp). This is similar to mpd, but unlike mpd, Moc comes with an interface. Its server does not support remote access.

## Installation

Install moc from the official repositories. The latest development version is available as moc-svn in the AUR.

## Configuration

The package includes a sample configuration file at `/usr/share/doc/moc/config. example`. To configure moc, copy this file to `~/.moc/config` and edit it.

For instructions about customizing the keybindings, read `/usr/share/doc/moc/keymap. example`.

If you want to use Moc with OSS v4.1, see OSS#MOC.

## Usage

Start moc:

    $ mocp

This will start the server and interface. Some useful shortcuts (case sensitive):

Start playing a track | Enter
Pause track | Space or p
Play next track | n
Play previous track | b
Switch from playlist browsing to filesystem browsing (and vice versa) | tab
Add one track to the playlist | a
Remove track from playlist | d
Add a folder recursively to playlist | A
Clear playlist | C
Increase volume 5% | . (dot)
Decrease volume 5% | , (comma)
Increase volume 1% | >
Decrease volume 1% | <
Change volume to 10% | meta + 1
Change volume to 20% | meta + 2
Quit player | q

Note: To shut down the server, use `Shift+q` or:

    $ mocp -x

## last.fm support

If you want to scrobble songs to last.fm (moc >= 2.5.0), install lastfmsubmitd. First edit `/etc/lastfmsubmitd.conf` and enable `lastfmsubmitd` with `systemctl`.

Then add the following line to the `~/.moc/config`:

    OnSongChange = "/usr/lib/lastfmsubmitd/lastfmsubmit --artist %a --title %t --length %d --album %r"

change permission:

    $ sudo chmod -R 777 /var/spool/lastfm

## Front-ends

- dmenu_mocp — Dmenu frontend to MOC

  https://github.com/mutantturkey/mocicon || dmenu_mocp

- mocicon — GTK panel applet to control MOC

  http://mocicon.sourceforge.net/ || mocicon

- moc-tray — Quick and easy access to mocp basic functions

  https://code.google.com/p/moc-tray/ || moc-tray

## Troubleshooting

### MOC fails to start

If MOC fails to start, it's most probably because of something wrong in `~/.moc/`. You can try to fix it, or simply delete the whole folder.

### Strange characters

If you see strange-like characters displayed in moc instead of the normal lines (vertical lines to separate space, etc.), you may have a font set incompatible to MOC. Either change the respective font, or edit `.moc/config` to use ASCII for drawing lines:

    ASCIILines = no

### FATAL_ERROR: Layout1 is malformed

If MOC crashes with this error, try adding either line to `.moc/config`:

    Layout1 = directory(0,0,50%,100%): playlist(50%,0,100%,100%)

or

    Layout1 = directory(0,0,50%,100%): playlist(50%,0,FILL,100%)

See original report and Debian bugs.

## See also

- Official documentation

Category:

- Player