Difference between revisions of "Cmus"

From ArchWiki
Jump to: navigation, search
(Created page with "{{i18n|cmus}} Category:Audio/Video (English) =Description= '''cmus''' ''(C* Music Player)'' is a small, fast and powerful console audio player. =Installation= [http://aur.ar...")
 
(Configuration)
(15 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{i18n|cmus}}
+
[[sr:Cmus]]
[[Category:Audio/Video (English)]]
+
[[Category:Player]]
=Description=
+
[http://cmus.sourceforge.net/ 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.
'''cmus''' ''(C* Music Player)'' is a small, fast and powerful console audio player.
+
  
 
=Installation=
 
=Installation=
[http://aur.archlinux.org/packages.php?ID=15893 cmus] can be installed from the [[AUR]].
+
[[pacman|Install]] {{Pkg|cmus}}, available in the [[Official Repositories]].
 +
 
 +
Alternatively, there is also a development version available in the [[AUR]] called {{AUR|cmus-git}}.
 +
 
 +
= Configuration =
 +
To configure cmus start it and switch to the configuration tab by pressing {{Keypress|7}}. Now you can see a list of default keybindings. Select a field in the list with the arrow keys and press{{Keypress|Enter}} to edit the values. You can also remove bindings with {{Keypress|D}} or {{Keypress|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 {{Keypress|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 whith alsa ==
 +
When using cmus with [[Advanced Linux Sound Architecture]] the default configuration does not allow playing music. To fix it change three variables, set {{ic|dsp.alsa.device}} to {{ic|default}} , set {{ic|mixer.alsa.channel}} to {{ic|Master}} and set {{ic|mixer.alsa.device}} to {{ic| default}}.
  
 
=Usage=
 
=Usage=
Line 15: Line 22:
 
== Starting Cmus ==
 
== Starting Cmus ==
  
When you first launch cmus it will open to the album/artist tab. To start cmus:
+
To start cmus, type:
 
  $ cmus
 
  $ cmus
 +
 +
When you first launch cmus it will open to the album/artist tab.
  
 
== Adding Music ==
 
== Adding Music ==
 
Press {{Keypress|5}} to switch to the file-browser tab so we can add some music.
 
Press {{Keypress|5}} to switch to the file-browser tab so we can add some music.
Now, use the arrow keys ({{Keypress|up}}, {{Keypress|down}}), {{Keypress|Enter}} and {{Keypress|Backspace}} to navigate to where you have audio files stored. To add music to your cmus library, use the arrow keys to hilight a file or folder, and press {{Keypress|a}}. When you press {{Keypress|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 {{Keypress|a}} on to your library. This can take a while if you added a folder with a lot 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.
+
Now, use the arrow keys ({{Keypress|up}}, {{Keypress|down}}), {{Keypress|Enter}} and {{Keypress|Backspace}} to navigate to where you have audio files stored. Alternatively, you may use the vim bindings ({{Keypress|k}}, {{Keypress|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 {{Keypress|a}}. When you press {{Keypress|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 {{Keypress|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.
 
{{Note|cmus does not move, duplicate or change your files. It just remembers where they are and caches the metadata (duration, artist, etc.)}}
 
{{Note|cmus does not move, duplicate or change your files. It just remembers where they are and caches the metadata (duration, artist, etc.)}}
{{Note|Cmus automatically saves your settings and library and everything when you quit}}
+
{{Note|Cmus automatically saves your settings, library and everything when you quit.}}
  
 
== Playing Tracks ==
 
== Playing Tracks ==
Press {{Keypress|1}} to go to the simple library view. Use the ({{Keypress|up}} and {{Keypress|down}} arrow keys to select a track you'd like to hear, and press {{Keypress|Enter}} to play it. Here's some keys to control play:
+
Press {{Keypress|1}} to go to the simple library view. Use the ({{Keypress|up}} and {{Keypress|down}} arrow keys (or {{Keypress|k}}, {{Keypress|j}}) to select a track you'd like to hear, and press {{Keypress|Enter}} to play it. Here's some keys to control play:
 
:Press {{Keypress|c}} to pause/unpause
 
:Press {{Keypress|c}} to pause/unpause
:Press {{Keypress|right}}/{{Keypress|left}} arrow keys to seek by 10 seconds
+
:Press {{Keypress|right}}/{{Keypress|left}} (or {{Keypress|h}}, {{Keypress|l}}) arrow keys to seek by 10 seconds
 
:Press {{Keypress|<}}/{{Keypress|>}} seek by one minute
 
:Press {{Keypress|<}}/{{Keypress|>}} seek by one minute
  
 
== Keybindings ==
 
== Keybindings ==
Press {{Keypress|7}} for a quick overview of the current keybindings and settings. To change a setting or keybind, just select it ({{Keypress|up}}/{{Keypress|down}} keys) and press {{Keypress|Enter}}. This will put the command for the current setting in the command now (bottom left of your screen), which you can edit to put in a new value/key.
+
See the configuration section on how to change keybindings.
 +
 
 +
== Remote Control ==
 +
Cmus can be controlled externally through a unix-socket with {{ic|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:
 +
 
 +
{{bc|<nowiki>
 +
#!/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
 +
</nowiki>}}
 +
 
 +
To use the previous script in [[Openbox]], copy the code above into a file {{ic|~/bin/cplay}}. Make the file executable using {{ic|chmod +x ~/bin/cplay}}. Next edit {{ic|~/.config/openbox/rc.xml}} and change the following key-bindings to look like this:
 +
{{note|Make sure there are no conflicting keybindings in rc.xml}}
 +
 
 +
{{hc|~/.config/openbox/rc.xml|<nowiki>
 +
  <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>
 +
</nowiki>}}
 +
 
 +
Now when you use the {{ic|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.
  
 
=Tabs=
 
=Tabs=
Line 55: Line 118:
  
 
== Settings tab (7) ==
 
== Settings tab (7) ==
Lists keybindings, unbound commands and options. Remove bindings with {{Keypress|D}} or {{Keypress|del}}, change bindings and variables with {{Keypress|Enter}} and toggle variables with {{Keypress|space}}.
+
Change settings. See configuration for further information.
 
+
=Features=
+
==Plugins==
+
:'''Input''': Ogg Vorbis, MP3, FLAC, Musepack, WavPack, WAV, AAC, MP4, and everything supported by ffmpeg (WMA, APE, MKA, TTA, SHN, ...) and libmodplug
+
:'''Output''': PulseAudio, ALSA, OSS, RoarAudio, libao, aRts, Sun, and WaveOut (Windows)
+
 
+
== Playing ==
+
:Gapless playback
+
:ReplayGain support
+
:MP3 and Ogg streaming (SHOUTcast/Icecast)
+
:Powerful playlist filters / live filtering
+
:Play queue
+
:Optional playback resume on startup
+
 
+
== Interface ==
+
:Instant startup, even with thousands of tracks
+
:Easy to use directory browser
+
:Customizable colors
+
:Dynamic keybindings. You can bind a key to any command, :seek +1m for example
+
:Vi / less style search mode
+
:Vi style command mode with tab completion
+
 
+
== Misc ==
+
:Excellent compilations handling
+
:Uses Unicode internally for all string handling
+
:Can run external commands for the currently selected files (tag-editor for example)
+
:Can be controlled via UNIX socket using cmus-remote command
+
  
 
=Links=
 
=Links=
 
# [http://gitorious.org/cmus Git Repository]
 
# [http://gitorious.org/cmus Git Repository]
 
# [http://cmus.sourceforge.net/ Website]
 
# [http://cmus.sourceforge.net/ Website]

Revision as of 11:57, 10 November 2012

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.

Installation

Install cmus, available in the Official Repositories.

Alternatively, there is also a development version available in the AUR called cmus-gitAUR.

Configuration

To configure cmus start it and switch to the configuration tab by pressing Template:Keypress. Now you can see a list of default keybindings. Select a field in the list with the arrow keys and pressTemplate:Keypress to edit the values. You can also remove bindings with Template:Keypress or Template:Keypress. 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 Template:Keypress. 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 whith alsa

When using cmus with Advanced Linux Sound Architecture the default configuration does not allow playing music. To fix it change three variables, set dsp.alsa.device to default , set mixer.alsa.channel to Master and set mixer.alsa.device to default.

Usage

Cmus comes with a great reference manual.

$ man cmus 
$ man cmus-tutorial
$ man cmus-remote

Starting Cmus

To start cmus, type:

$ cmus

When you first launch cmus it will open to the album/artist tab.

Adding Music

Press Template:Keypress to switch to the file-browser tab so we can add some music. Now, use the arrow keys (Template:Keypress, Template:Keypress), Template:Keypress and Template:Keypress to navigate to where you have audio files stored. Alternatively, you may use the vim bindings (Template:Keypress, Template:Keypress) 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 Template:Keypress. When you press Template:Keypress 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 Template:Keypress 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.

Note: cmus does not move, duplicate or change your files. It just remembers where they are and caches the metadata (duration, artist, etc.)
Note: Cmus automatically saves your settings, library and everything when you quit.

Playing Tracks

Press Template:Keypress to go to the simple library view. Use the (Template:Keypress and Template:Keypress arrow keys (or Template:Keypress, Template:Keypress) to select a track you'd like to hear, and press Template:Keypress to play it. Here's some keys to control play:

Press Template:Keypress to pause/unpause
Press Template:Keypress/Template:Keypress (or Template:Keypress, Template:Keypress) arrow keys to seek by 10 seconds
Press Template:Keypress/Template:Keypress seek by one minute

Keybindings

See the configuration section on how to change keybindings.

Remote Control

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:

Note: Make sure there are no conflicting keybindings in rc.xml
~/.config/openbox/rc.xml
  <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.

Tabs

There are 7 tabs in cmus. Press keys Template:Keypress-Template:Keypress 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).

Browser (5)

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.

Links

  1. Git Repository
  2. Website