MOC (music on console)

mocp_playlist

Greetings, and welcome to this short article, my name is Martín, and today I will talk about the audio player MOC.

Introduction.

I just read the article about MPD published on this site, it seems to me an excellent contribution. However, before knowing of MPD met MOC.

«MOC is an audio player that runs on a console using a simple ncurses-based interface. Supported audio formats include OGG, MP3, WAV, among others. »

Extracted from the man pages.

When to use MOC?

When starting my journey through the world GNU / Linux, I came across the window manager KDE. I was stumped by the stationery on it, so much so that I stayed for over six months. But one day I came home and decided to try something new (streamline my work environment), and flux box he was ready, waiting for a chance.

Then my machine started to breathe, so many processes stopped (processes that it didn't really require); but KDE was still there -with Amarok- and that made me uneasy.

One day i discovered MOC, it was surprising because no extra configuration was necessary, I just run mockup in a command terminal or command launcher Alt + F2 and I enter: xterm -e mocp.

The program responds with a couple of sections, on the right side we have our directories, and on the left side our playlist will appear.

Consult the help.

Once started, we press the key h. The program responds with a list of available options.

Among the most important we have:
q -> Exit the player. Just quit, don't stop playback.
a -> Add a file or directory to the playlist. To use this option we must first navigate with the arrow keys and choose the directory where our audio files are located.
A -> Add a directory recursively to the playlist. To use this option we must first navigate with the arrow keys and choose the directory where our audio files are located.

p -> Play the selected track.
n -> Play next track.
b -> Play previous track.
s -> Stop the player.
p o Space -> Pause the player.
Tab -> Navigate between the playlist and the user's file system.

But what happens, this is not really your great advantage. In my opinion, the ideal is to load the server when you log in and activate the playback using keyboard shortcuts. For this, you must consult the manuals of the player.

Fluxbox + MOC

When running man mocp, we access the documentation that comes with MOCP. From there we get that to start the server, we need mocp -S, which allows to launch the server.

It is then that we edit our login settings, then we show how to achieve this in flux box.

flux box stores its configuration files in a hidden directory within each user's home directory ~ / .fluxbox /. There we find the files: apps, init, Keys, menu, overlay, startup, among others; and some more configuration directories.

We will start by editing the file startup. From a terminal we execute vim ~ / .fluxbox / startup and we add mocp -S, just before the line exec flux box, as the picture shows

mocp_edit_startup

We save changes, and close vim. One vim not to your liking, you can use some other text editor.

Other options that interest me from the manuals MOC neighborhoods, are the Next, Previous, stop, play, pause, unpause, seek, theme. Correct a shortcut to play, next, previous, stop, ...

Then we edit the file Keys. In this file there is a lot to explore, I will try to be as brief as possible. We have to Mod1 is equivalent to the key Alt, so I'll use it to define my keybindings:

Atajos para moc

Mod1 Shift Z :Exec xterm -bg black -fa monospace -fs 11 -e mocp --theme green_theme
Mod1 P :Exec mocp -t shuffle,autonext --play
Mod1 S :Exec mocp --stop
Mod1 N :Exec mocp --next
Mod1 B :Exec mocp --previous
Mod1 L :Exec mocp --pause
Mod1 K :Exec mocp --unpause
Mod1 Shift S :Exec mocp --seek -3

By defining the previous combinations we can:

  • Open the player with: Alt + Shift + Z, I have also indicated that I want to use the theme green_theme. For more topics, run ls /usr/share/moc/themes/
  • Similarly, we start playback with Alt + P. The option -t shuffle, autonext indicates that I want to use random mode and have the audio tracks played one after the other.
  • With Alt + N we play the next track, and so on with the rest of the keyboard shortcuts.

And ... in KDE?

KDE+MOC

Very well, mockup it has been to your liking but you want to stay in KDE. Let's apply the same settings:

  • Alt + F2, we introduce: systemsettings
  • We proceed in Quick accesses and gestures
  • mocp_edit_accesses_fast

    Now Right click > New group

  fast_accesos1

  • We put a name to our group
  • Right click> New> Global shortcut> Order / URL:

fast_accesos2

  • Now in the trigger tab place the desired shortcut
  • fast_accesos3

    And in the Action tab we place the appropriate command for each shortcut.

Well that's it with this little tutorial. I hope you like it and continue customizing GNU / Linux.
[specs]

  • Laptop: Samsung RV415
  • OS: GNU / Slackware Linux v14.1
  • WM: Fluxbox, KDE
[/specs]
For this tutorial, we start from a complete installation of the GNU / Slackware Linux Operating System; therefore, all software packages are installed. If this is not your case, we enter as superuser and use MARKDOWN_HASH0ac53b8a47f34f5ed67043157642cf65MARKDOWN_HASH.

References:

http://moc.daper.net/

http://www.slackware.com
http://fluxbox-wiki.org/index.php/Keyboard_shortcuts
http://www.fluxbox.org


The content of the article adheres to our principles of editorial ethics. To report an error click here.

21 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Bla bla bla said

    I still prefer ncmpcpp ...

    1.    to that said

      ( before adding to the library or creating the list), I think it is the biggest attribute of the moc, which is a bit complicated in the mpd.

  2.   f3niX said

    The truth is the best player on the console, I have been using it for a long time and it is the best. But I would never leave Kde for fluxbox, haha ​​I'm very comfortable here.

  3.   eliotime3000 said

    Very useful, for those people who want pure minimalism. And by the way, I'm also using Slackware.

    1.    Richard said

      changing the subject: is it possible to fulfill dependencies automatically in Slackware? I've always wanted to try but I don't dare

  4.   auroszx said

    Interesting 🙂 Another good option is MPD, which once configured you can use it with different interfaces. Cantata in KDE, Sonata in GTK desktops, various options in the terminal ... Control it remotely from Android / iOS / other PCs ... More potential, but to taste the colors 🙂

    1.    Tarquin said

      You have said it, MPD is more powerful but at the end of the day what matters is how the user adapts to the player

  5.   Leo said

    Very good article, it is useful to me. I'm going to use it in my Openbox in Arch, since thanks to a burning in a RAM module I was left with 1Gb.
    Thanks for the input.

  6.   Algave said

    Very good even that I prefer to use ncpcpp and even later I try moc so as not to stay without trying it and be able to give my opinion of it, greetings and thanks! 0 /

  7.   Algave said

    Sorry I meant * ncmpcpp

  8.   Nebuchadnezzar said

    Much lighter, simpler and minimalist I recommend cplay.
    I have it on my Gentoo with openbox at home and at work on a freebsd server also with openbox.

  9.   RAW-Basic said

    Thanks! .. ..it comes in a thousand pearls .. ..I will adapt it to my Openbox in Arch ..

  10.   seachello said

    I also use this player sometimes. It is perfectly solvent to satisfy my musical needs in general and by terminal.

    I also really like fluxbox! The shortcut trick is very useful!

  11.   Tesla said

    Excellent post, very detailed and original!

    I use Banshee to manage my music library which is quite clumsy. However to reproduce something specific I like this way. 🙂

    I'll put into practice! Cheers!

  12.   Gonzalo said

    Can also be with mplayer

  13.   Wada said

    Great but I still prefer MPD + NCMPCPP 😀

    PD ¿Banda MS ?, ¿Espinoza Paz? hahahaha Greetings from Sinaloa 🙂

  14.   od_air said

    Moc is the best player in the world and its surroundings… ..

  15.   e2391 said

    mpd + ncmpcpp> *

    Salu2

  16.   poor taku said

    Excellent, I'm testing it and I don't think I'm going back to the graphical interface!

  17.   nuanced said

    Very good!

  18.   sgmart said

    Greetings to all, I am glad to know that there is a community, and that it is interested in free alternatives.

    A small correction, the 'p' key is not for play, use 'Enter' for that purpose.

    I have tried to edit the post but apparently that option was not contemplated, hehe.