Difference between revisions of "Moc"

From ArchWiki
Jump to: navigation, search
(Frontends)
m
(11 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Audio/Video]]
+
[[Category:Player]]
 
[[de:Moc]]
 
[[de:Moc]]
 
[[es:Moc]]
 
[[es:Moc]]
Line 6: Line 6:
 
[[sr:Moc]]
 
[[sr:Moc]]
 
'''M'''usic '''O'''n '''C'''onsole is a lightweight music player. It consists of 2 parts, a server (Moc) and the player/interface (Mocp).  
 
'''M'''usic '''O'''n '''C'''onsole is a lightweight music player. It consists of 2 parts, a server (Moc) and the player/interface (Mocp).  
This is similar to [[mpd]], but unlike mpd, Moc comes with an interface.
+
This is similar to [[mpd]], but unlike mpd, Moc comes with an interface, although its server doesn't support access through net.
  
==Installation==
+
== Installation ==
  
Sync and install with pacman:
+
[[pacman|Install]] {{Pkg|moc}} from the [[official repositories]].
# pacman -S moc
+
  
 
==Configuration==
 
==Configuration==
 
The package includes a sample configuration file at {{ic|/usr/share/doc/moc/config.example}}. To configure moc, copy this file to {{ic|~/.moc/config}} and edit it.
 
The package includes a sample configuration file at {{ic|/usr/share/doc/moc/config.example}}. To configure moc, copy this file to {{ic|~/.moc/config}} and edit it.
  
For instructions about customising the keybindings, read {{ic|/usr/share/doc/moc/keymap.example}}.
+
For instructions about customizing the keybindings, read {{ic|/usr/share/doc/moc/keymap.example}}.
  
 
If you want to use Moc with [[OSS]] v4.1, see [[OSS#MOC]].
 
If you want to use Moc with [[OSS]] v4.1, see [[OSS#MOC]].
Line 42: Line 41:
 
| b
 
| b
 
|-
 
|-
| Switch from playlist browsing to filesystem browsing (and vice versa)
+
| Switch from playlist browsing to<br/> filesystem browsing (and vice versa)
 
| tab
 
| tab
 
|-
 
|-
Line 82: Line 81:
 
  $ mocp -x
 
  $ mocp -x
  
==Unstable versions==
+
==Development versions==
  
You can obtain these from the AUR. MOC 2.4.0 (stable) was released in 2006. Features since then are in 2.5, but are not yet blessed “stable” as of writing.
+
You can obtain these from the [[AUR]]. MOC 2.4.0 (stable) was released in 2006. Features since then are in 2.5, but are not yet blessed “stable” as of writing.
  
* {{AUR|moc-svn}}
+
* {{AUR|moc-svn}} (latest development code)
* {{AUR|moc-devel}} (alpha version for next release)
+
* {{AUR|moc-devel}} (old alpha version for next release)
  
==MOC + last.fm==
+
==last.fm support==
  
If you want scrobble songs to last.fm you need moc >= 2.5.0. See [[#Unstable versions]] above.
+
If you want scrobble songs to last.fm (moc >= 2.5.0 needed), install {{pkg|lastfmsubmitd}}. It is a daemon which is available in the "community" repository. First edit {{ic|/etc/lastfmsubmitd.conf}} and enable both services {{Ic|lastfmsubmitd}} and {{Ic|lastmp}} with {{Ic|systemctl}}.
  
First install lastfmsubmitd. It is a daemon which is available in the "community" repository.  To install it, first edit {{ic|/etc/lastfmsubmitd.conf}} and add both {{Ic|lastfmsubmitd}} and {{Ic|lastmp}} to the {{Ic|DAEMONS}} array in {{ic|/etc/rc.conf}}.
+
If services do not exists create them first:
  
Now configure moc:
+
create {{Ic|/etc/systemd/system/lastmp.service}} file and add following in it:
  
$ vim ~/.moc/config
+
{{bc|[Unit]
add line:
+
Description&#61;LastMP
OnSongChange = "/usr/lib/lastfmsubmitd/lastfmsubmit --artist %a --title %t --length %d --album %b"
+
After&#61;mpd.service
 +
 
 +
[Service]
 +
ExecStart&#61;/usr/bin/lastmp --no-daemon
 +
 
 +
[Install]
 +
WantedBy&#61;multi-user.target}}
 +
 
 +
create {{Ic|/etc/systemd/system/lastfmsubmitd.service}} file and add following in it:
 +
 
 +
{{bc|[Unit]
 +
Description&#61;LastFM Submit daemon
 +
After&#61;network.target
 +
 
 +
[Service]
 +
ExecStart&#61;/usr/bin/lastfmsubmitd --no-daemon
 +
 
 +
[Install]
 +
WantedBy&#61;multi-user.target}}
 +
 
 +
 
 +
Now add the following line to the moc configuration file:
 +
 
 +
{{hc|~/.moc/config|OnSongChange &#61; "/usr/lib/lastfmsubmitd/lastfmsubmit --artist %a --title %t --length %d --album %r"}}
  
 
change permission:
 
change permission:
Line 105: Line 127:
 
  $ sudo chmod -R 777 /var/spool/lastfm
 
  $ sudo chmod -R 777 /var/spool/lastfm
  
thats all.
+
that's all.
  
==Frontends==
+
==Front-ends==
[https://aur.archlinux.org/packages.php?ID=39708 dmenu_mocp] is a dmenu frontend for moc
+
* {{AUR|dmenu_mocp}} is a dmenu frontend for moc
 
+
* {{AUR|mocicon}} GTK panel applet
[https://www.archlinux.org/packages/community/any/moc-tray/ moc-tray] is a perl gtk dock that gives you access to moc functions
+
* {{Pkg|moc-tray}} is a perl GTK dock that gives you access to moc functions
  
 
==Troubleshooting==
 
==Troubleshooting==
===moc fails to start===
+
moc fails to start
If moc fails to start, it's most probably because of something wrong in {{ic|~/.moc/}}. You can try to fix it, or simply delete the folder {{ic|~/.moc/}}.
+
If moc fails to start, it's most probably because of something wrong in {{ic|~/.moc/}}. You can try to fix it, or simply delete the whole folder.
 +
 
 +
If you see strange-like characters displayed in moc instead of the normal lines (vertical lines to separate space, etc.) likely you've a font set which MOC doesn't play nice with. You can either change the font you have selected for your terminal or edit the MOC config file (search config file for something about use ASII only).
 +
 
 +
==Additional resources==
 +
* [http://moc.daper.net/documentation Official documentation]

Revision as of 18:02, 26 June 2013

Music On Console is a lightweight music player. It consists of 2 parts, a server (Moc) and the player/interface (Mocp). This is similar to mpd, but unlike mpd, Moc comes with an interface, although its server doesn't support access through net.

Installation

Install moc from the official repositories.

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

To start moc:

$ mocp

This will start the server and interface. You will enter player interface. Some useful shortcuts to use mocp (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 the shift (capital) Q key or:

$ mocp -x

Development versions

You can obtain these from the AUR. MOC 2.4.0 (stable) was released in 2006. Features since then are in 2.5, but are not yet blessed “stable” as of writing.

  • moc-svnAUR (latest development code)
  • moc-develAUR (old alpha version for next release)

last.fm support

If you want scrobble songs to last.fm (moc >= 2.5.0 needed), install lastfmsubmitd. It is a daemon which is available in the "community" repository. First edit /etc/lastfmsubmitd.conf and enable both services lastfmsubmitd and lastmp with systemctl.

If services do not exists create them first:

create /etc/systemd/system/lastmp.service file and add following in it:

[Unit]
Description=LastMP
After=mpd.service

[Service]
ExecStart=/usr/bin/lastmp --no-daemon

[Install]
WantedBy=multi-user.target

create /etc/systemd/system/lastfmsubmitd.service file and add following in it:

[Unit]
Description=LastFM Submit daemon
After=network.target

[Service]
ExecStart=/usr/bin/lastfmsubmitd --no-daemon

[Install]
WantedBy=multi-user.target


Now add the following line to the moc configuration file:

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

change permission:

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

that's all.

Front-ends

  • dmenu_mocpAUR is a dmenu frontend for moc
  • mociconAUR GTK panel applet
  • moc-tray is a perl GTK dock that gives you access to moc functions

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.

If you see strange-like characters displayed in moc instead of the normal lines (vertical lines to separate space, etc.) likely you've a font set which MOC doesn't play nice with. You can either change the font you have selected for your terminal or edit the MOC config file (search config file for something about use ASII only).

Additional resources