Greetings, and welcome to this short article, my name is Martín, and today I will talk about the audio player MOC.
Table of Contents
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
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
- 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?
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
Now Right click > New group
- We put a name to our group
- Right click> New> Global shortcut> Order / URL:
- Now in the trigger tab place the desired shortcut
Well that's it with this little tutorial. I hope you like it and continue customizing GNU / Linux.
- Laptop: Samsung RV415
- OS: GNU / Slackware Linux v14.1
- WM: Fluxbox, KDE