cmus (C* MUsic Player) is a small, fast and powerful console audio player which supports most major audio formats. Various features include gapless playback, ReplayGain support, MP3 and Ogg streaming, live filtering, instant startup, customizable key-bindings, and vi-style default key-bindings.
- 1 Installation
- 2 Configuration
- 3 Usage
- 4 Tabs
- 5 Links
Alternatively, there is also a development version available in the AUR called AUR.
To configure cmus start it and switch to the configuration tab by pressing
7. Now you can see a list of default keybindings. Select a field in the list with the arrow keys and press
Enter to edit the values. You can also remove bindings with
del. To edit unbound commands and option variables scroll down in the list to the relevant section. Variables can also be toggled instead of edited with
space. Cmus allows changing the color of nearly every interface element. You can prefix colors with "light" to make them appear brighter and set attributes for some text elements.
Using cmus with alsa
When using cmus with Advanced Linux Sound Architecture the default configuration does not allow playing music. To fix it change three variables, set
default , set
Master and set
Cmus comes with a great reference manual.
$ man cmus $ man cmus-tutorial $ man cmus-remote
To start cmus, type:
When you first launch cmus it will open to the album/artist tab.
5 to switch to the file-browser tab so we can add some music.
Now, use the arrow keys (
Backspace to navigate to where you have audio files stored. Alternatively, you may use the vim bindings (
j) to navigate up and down through your music.
To add music to your cmus library, use the arrow keys to highlight a file or folder, and press
a. When you press
a cmus will move you to the next line down (so that it is easy to add a bunch of files/folders in a row) and start adding the file/folder you pressed
a in to your library. This may take a bit if you added a folder with a lot of music in it. As files are added, you will see the second time in the bottom right go up. This is the total duration of all the music in the cmus library.
1 to go to the simple library view. Use the (
down arrow keys (or
j) to select a track you'd like to hear, and press
Enter to play it. Here's some keys to control play:
l) arrow keys to seek by 10 seconds
>seek by one minute
See the configuration section on how to change keybindings.
Cmus can be controlled externally through a unix-socket with
cmus-remote. This makes it easy to control playback through an external application or key-binding.
One such usage of this feature is to control playback in Cmus with the XF86 keyboard events. The following script when run will start Cmus in an xterm terminal if it isn't running, otherwise it will will toggle play/pause:
#!/bin/sh # # Author: Dennis Hodapp # Filename: cplay # Requires: cmus # # Tests if cmus is running and starts it if it isn't. # Else it toggles play/pause. # This command will break if you rename it to # something containing "cmus". TERMINAL=/usr/bin/xterm SHELL=/bin/sh if ! ps aux | grep -w "cmus$" | grep -v grep > /dev/null ; then $TERMINAL -e $SHELL -c cmus & > /dev/null else cmus-remote -u fi
To use the previous script in Openbox, copy the code above into a file
~/bin/cplay. Make the file executable using
chmod +x ~/bin/cplay. Next edit
~/.config/openbox/rc.xml and change the following key-bindings to look like this:
<keyboard> <keybind key="XF86AudioPlay"> <action name="Execute"> <command>cplay</command> </action> </keybind> <keybind key="XF86AudioNext"> <action name="Execute"> <command>cmus-remote -n</command> </action> </keybind> <keybind key="XF86AudioPrev"> <action name="Execute"> <command>cmus-remote -r</command> </action> </keybind> </keyboard>
Now when you use the
XF86AudioPlay key on your keyboard, cmus will open up. If it's opened already it will then start playing. Using the XF86AudioNext and XF86AudioPrev keys will change tracks.
There are 7 tabs in cmus. Press keys
7 to change active tab.
Library tab (1)
Display all tracks in so-called library. Tracks are sorted artist/album tree. Artist sorting is done alphabetically. Albums are sorted by year.
Sorted library tab (2)
Displays same content as view, but as a simple list which is automatically sorted by user criteria.
Playlist tab (3)
Displays editable playlist with optional sorting.
Play Queue tab (4)
Displays queue of tracks which are played next. These tracks are played before anything else (i.e. the playlist or library).
Directory browser. In this tab, music can be added to either the library, playlist or queue from the filesystem.
Filters tab (6)
Lists user defined filters.
Settings tab (7)
Change settings. See configuration for further information.