cmus

Langue: en

Autres versions - même langue

Version: 255414 (debian - 07/07/09)

Section: 1 (Commandes utilisateur)

NAME

cmus - C* Music Player

SYNOPSIS

cmus [options]

DESCRIPTION

cmus is a small ncurses based music player. It supports various output methods by output-plugins. It has got completely configurable keybindings and it can be controlled from the outside via cmus-remote(1).

OPTIONS

--listen ADDR
Listen to ADDR (UNIX socket) instead of /tmp/cmus-$USER. ADDR is either a UNIX socket or host[:port].
WARNING: Using host[:port] is insecure even with password! It might be useful though in LAN if you want multiple local users to able to control cmus. Never make cmus listen to the internet.
NOTE: Don't use this option to run multiple instances as same user. That would corrupt the track metadata cache.

--plugins

List available plugins and exit.

--help

Display usage information and exit.

--version

Display version information and exit.

VIEWS

There are 7 views in cmus. Press keys 1-7 to change active view.

Library view (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 view (2)

Displays same content as view 1, but as a simple list which is automatically sorted by user criteria.

Playlist view (3)

Displays editable playlist with optional sorting.

Play Queue view (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 view, music can be added to either the library, playlist or queue from the filesystem.

Filters view (6)

Lists user defined filters.

Settings view (7)

Lists keybindings, unbound commands and options. Remove bindings with D or del, change bindings and variables with enter and toggle variables with space.

COMMAND LINE

Everything in cmus is implemented as commands which can be typed at command line or bound to a key. To enter command mode type :. To execute a command press ENTER or to cancel press ESC. Use up/down arrows to browse command history. Use TAB to complete commands and parameters, you can tab complete almost anything. You don't need to type full command names if the command is unambiguous (no other commands starting with the same characters).

Examples:

 # add files, short for ':add ~/music'
 :a ~/music
 
 # change output plugin
 :set output_plugin=oss
 
 # start playing
 # you could just press 'x' which is the default
 # binding for this command
 :player-play
 
 # clear current view (library, playlist or play queue)
 :clear
 

SEARCHING

Search mode works like the command mode, to enter search mode press / and then type the search words and press ENTER. Press n to search next or N to search previous match using the same search words. Type ? to search backwards.

In views 1-4 words are compared to artist, album and title tags. Type //WORDS or ??WORDS to search only artists/albums in view 1 or titles in views 2-4. If the file doesn't have tags words are compared to filename without path.

Searching works in views 5-7 too and its logic should be pretty obvious.

PLAYLIST EDITING

Selecting Tracks

Editing commands affect the currently marked tracks or if there are no marked tracks the currently selected track (or selected artist/album in view 1).

Mark selected track by pressing SPACE. Marked tracks appear with a gray background. You can only mark tracks in the list views (2-4).

Copying Tracks Between Views

You can copy marked or selected tracks from views 1-5.
a
copy tracks to the library (1-2)
y
copy tracks to the playlist (3)
e
append tracks to the play queue (4)
E
prepend tracks to the play queue (4)

Moving Tracks

In views 2-4 you can move tracks withing the list. Note that moving is disabled if the view is auto-sorted (see lib_sort and pl_sort options).

Pressing p moves marked tracks to the position immediately after the selected track. P moves them to the position immediately before the selected track. If there are no marked tracks then the selected track is moved down (p) or up (P).

NOTE: Changing active filters reloads view 2 so it isn't a good idea to manually order tracks in the view.

Removing Tracks

Press D or delete to remove marked or selected tracks in the current view (1-4). The tracks will be removed immediately from the view without asking for confirmation. In the browser and filters views the same keys are used to remove a file or filter (will ask for confirmation).

STATUS LINE

Right hand side of the status line (second row from the bottom, black text on a grey background) consists of the following fields:
 aaa_mode & play_sorted & play_library | continue repeat shuffle
 

NOTE: aaa_mode and play_sorted will be displayed only if play_library is true because these are meaningless when playing the playlist (view 3).

Pressing m, o, M, C, r and s keys should make it easier to understand what all those fields mean.

See CONFIGURATION OPTIONS section for more information about these options.

KEYBINDINGS

Here's list of default keybindings. See unbind and bind commands in the COMMANDS section.

Common Context

 ^C             echo Type :quit<enter> to exit cmus.
 I              echo {}
 b              player-next
 c              player-pause
 x              player-play
 z              player-prev
 v              player-stop
 ^L             refresh
 n              search-next
 N              search-prev
 .              seek +1m
 l, right       seek +5
 ,              seek -1m
 h, left        seek -5
 m              toggle aaa_mode
 C              toggle continue
 M              toggle play_library
 o              toggle play_sorted
 r              toggle repeat
 t              toggle show_remaining_time
 s              toggle shuffle
 1              view tree
 2              view sorted
 3              view playlist
 4              view queue
 5              view browser
 6              view filters
 7              view settings
 ]              vol +0 +1
 [              vol +1 +0
 +, =           vol +10%
 }              vol -0 -1
 {              vol -1 -0
 -              vol -10%
 enter          win-activate
 E              win-add-Q
 a              win-add-l
 y              win-add-p
 e              win-add-q
 G, end         win-bottom
 down, j        win-down
 p              win-mv-after
 P              win-mv-before
 tab            win-next
 ^F, page_down  win-page-down
 ^B, page_up    win-page-up
 D, delete      win-remove
 i              win-sel-cur
 space          win-toggle
 g, home        win-top
 k, up          win-up
 u              win-update
 

Browser Context

 backspace      browser-up
 i              toggle show_hidden
 

COMMANDS

This section describes cmus' commands. You can bind a key to any of these commands, put these commands to configuration files and execute them in command mode. Also cmus-remote uses these commands in its protocol.

Optional parameters are in brackets, obligatory parameters in angle brackets and default key bindings in parenthesis.

add [-l] [-p] [-q] [-Q] <file|dir|url|playlist>

Add file/dir/url/playlist to the specified view or the current view.
-l
add to library
-p
add to playlist
-q
add play queue
-Q
prepend to play queue
URL is a Shoutcast stream (http://...).
Supported playlist: plain, .m3u, .pls.

bind [-f] <context> <key> <command>

Add a key binding.
-f
overwrite existing binding
Use tab to expand contexts, keys and commands. Command is any command listed in this section.
Valid key contexts
common, library (1-2), playlist (3), queue (4), browser (5), filters (6)
There's one context for each view. Common is a special context on which bound keys work in every view.
You can override specific keys in common context for a view. For example i selects the current track in views 1-3 but in browser it is overridden to toggle showing of hidden files.

browser-up (backspace)

Change to parent directory in browser view (5). This command only makes sense to be bound to the browser key context although it's possible to use this even if browser view is not active.

cd [directory]

Changes the current working directory. Changes the directory displayed in browser view too.

clear [-l] [-p] [-q]

Remove all tracks from the specified view or the current view.
-l
clear library
-p
clear playlist
-q
clear play queue

colorscheme <name>

Change color scheme. Color schemes are found in /usr/share/cmus/ or ~/.cmus/ and have .theme filename extension.

echo <arg>...

Display arguments on the command line.
If the arguments contain {} it is replaced with file name of the first selected track.
NOTE: unlike with run the {} is replaced with only the first selected filename.
Default bindings:
 common  I   echo {}
 common  ^C  echo Type :quit<enter> to exit cmus.
 

factivate <user-defined-filter>...

Select and activate the given user defined filters (displayed in the filters view). Filter names are separated by spaces. This command is mostly useful when bound to a key, to change active filters very quickly. If no arguments given then all filters are unactivated.
If you prefix a filter name with "!" then the filter value is negated before activation.

filter <filter-expression>

Use this command when you want to temporarily filter contents of the library views without having separately define (fset) and activate the filter. The filter is not saved.

fset <name>=<filter-expression>

Define (or replace existing) filter and add it to filters view (6).

invert

Invert the marking of tracks in playlist and queue views. See mark and unmark.

load [-l] [-p] <playlist>

Load a playlist to the specified view or to the current view.
-l
load to library views
-p
load to playlist view

lqueue [NUM]

Queue NUM (default 1) random albums from the library. See also tqueue.

mark <filter-expression>

Mark tracks in playlist and queue view by using a filter expression.

player-next (b)

Skip to the next track.

player-pause (c)

Toggle pause.

player-play (x)

If stopped, start playing the current song; if already playing seek to beginning of the current song.

player-prev (z)

Skip to the previous track.

player-stop (v)

Stop playback.

prev-view

Go to previously used view.

quit

Exit cmus.

refresh (^L)

Redraw the terminal window.

run <command>

Run command for the marked tracks OR the selected one if none marked.
By default file names are appended to the command. If the command contains {} it is replaced with list of filenames.
NOTE: In view 1 you can run a command for all files in the selected album or artist.

save [-l] [-p] [file]

Save the specified view's or the current view's contents to a playlist file.
-l
save library views
-p
save playlist view
If no filename given the old filename is used.

search-next (n)

If a search pattern has been entered before, search forward for the next match in the current view. See SEARCHING above.

search-prev (N)

If a search pattern has been entered before, search backwards for the previous match in the current view. See SEARCHING above.

seek [+-](<num>[mh] | [HH:]MM:SS)

Seek to absolute or relative position. Position can be given in seconds, minutes (m), hours (h) or HH:MM:SS format where HH: is optional.
Seek 1 minute backward
:seek -1m
Seek 5 seconds forward
:seek +5
Seek to absolute position 1h
:seek 1h
Seek 90 seconds forward
:seek +1:30
Default bindings:
 common  ,      :seek -1m
 common  .      :seek +1m
 common  l      :seek +5
 common  h      :seek -5
 common  right  :seek +5
 common  left   :seek -5
 

set <option>=<value>

Set value of an option. See OPTIONS.

set <option>

Display option value. Vim compatible set <option>? is also supported.

showbind <context> <key>

Show key binding.

shuffle

Reshuffle the shuffle lists for both library and playlist views.

source <filename>

Read and execute commands from <filename>.

toggle <option>

Toggle value of a toggle-able option (all booleans and tristate aaa_mode).

tqueue [NUM]

Queue NUM (default 1) random tracks from the library. See also lqueue.

unbind [-f] <context> <key>

Remove a key binding. Use tab to cycle through bound keys.
-f
Don't throw an error if the binding is not known

unmark

Unmark all tracks (see mark).

view <name or 1-7>

Switches active view.

vol [+-]NUM[%] [[+-]NUM[%]]

Set, increase or decrease volume.
If you give vol just one argument it changes both channels. Two values make it possible to change the left and right channel independently.
To increase or decrease volume prefix the value with - or +, otherwise value is treated as absolute volume.
Both absolute and relative values can be given as percentage units (suffixed with %) or as internal values (hardware may have volume in range 0-31 for example).
Default bindings:
 common  =  :vol +10%
 common  +  :vol +10%
 common  -  :vol -10%
 common  [  :vol +1 +0
 common  ]  :vol +0 +1
 common  {  :vol -1 -0
 common  }  :vol -0 -1
 

win-activate (enter)

In views 1-3 start playing the selected track. In view 5 start playing the selected track or change to the selected directory. In view 6 activate the selected filters. In settings view (7) change binding or variable.

win-add-l (a)

Add the currently marked or selected track(s) (views 3-4), or the currently selected file or directory (view 5) to the library.
Analogous to :add -l

win-add-p (y)

Add the currently marked or selected track(s) (views 1-2, 4), or the currently selected file or directory (view 5) to the playlist.
Analogous to :add -p

win-add-Q (E)

Prepend the currently marked or selected track(s) (views 1-3), or the currently selected file or directory (view 5) to the play queue.
Analogous to :add -Q

win-add-q (e)

Add the currently marked or selected track(s) (views 1-3), or the currently selected file or directory (view 5) to the play queue.
Analogous to :add -q

win-bottom (G, end)

Goto bottom of the current window.

win-down (j, down)

Goto down one row in the current window.

win-mv-after (p)

If no tracks are marked, move the selected track down one row. If any tracks are marked, move the marked tracks after the currently selected track. This command works in unsorted playlist and play queue view.

win-mv-before (P)

If no tracks are marked, move the selected track up one row. If any tracks are marked, move the marked tracks before the currently selected track. This command works in unsorted playlist and play queue view.

win-next (tab)

Activate next window. Only relevant in view 1.

win-page-down (^F, page_down)

Goto down one page in the current window.

win-page-up (^B, page_up)

Goto up one page in the current window.

win-remove (D, delete)

Remove the selected entry. For tracks no confirmations are made. For files (view 5), filters (view 6) and bindings (view 7) user has to confirm the action.

win-sel-cur (i)

Select the current track (position in library or playlist, not necessarily same as the currently playing track). Works only in views 1-3, does nothing in other views.

win-toggle (space)

Expand albums in library view (1), mark tracks in views 2-4, toggle selection of a filter in view 6, toggle variable value in view 7.

win-top (g, home)

Goto top of the current window.

win-up (k, up)

Goto up one row in the current window.

win-update (u)

Checks the modification time of the files in the library, and updates metadata for changed files. Removes non-existent files from the library.
Reloads contents of directory in the browser view.
Only works in views 1-2 and 5, does nothing in other views.

CONFIGURATION OPTIONS

This section describes cmus' options that can be altered with the set and toggle commands. Default values are in parenthesis, possible values in brackets.

auto_reshuffle (false)

Reshuffle playlist when end of shuffle list is reached.

aaa_mode (all) [all, artist, album]

Defines what tracks should be played in the library view. Not used in the other views. For example if set to artist the player behaves like there were only the files of the currently playing artist in the library.

altformat_current [Format String]

Alternative format string for the line displaying currently playing track.

altformat_playlist [Format String]

Alternative format string for the list views (2-4).

altformat_title [Format String]

Alternative format string for terminal tittle. NOTE: not all terminals support changing window title.

altformat_trackwin [Format String]

Alternative format string for the tree view's (1) track window.

buffer_seconds (10) [1-20]

Size of player buffer in seconds.

color_cmdline_bg (default) [Color]

Command line background color.

color_cmdline_fg (default) [Color]

Command line foreground color.

color_error (lightred) [Color]

Color of error messages displayed on the command line.

color_info (lightyellow) [Color]

Color of informational messages displayed on the command line.

color_separator (blue) [Color]

Color of the separator line between windows in view (1).

color_statusline_bg (gray) [Color]

Status line background color.

color_statusline_fg (black) [Color]

Status line foreground color.

color_titleline_bg (blue) [Color]

Background color of the line displaying currently playing track.

color_titleline_fg (white) [Color]

Foreground color of the line displaying currently playing track.

color_win_bg (default) [Color]

Window background color.

color_win_cur (lightyellow) [Color]

Color of currently playing track.

color_win_cur_sel_bg (blue) [Color]

Background color of the selected row which is also the currently playing track in active window.

color_win_cur_sel_fg (lightyellow) [Color]

Foreground color of the selected row which is also the currently playing track in active window.

color_win_dir (lightblue) [Color]

Color of directories in browser.

color_win_fg (default) [Color]

Window foreground color.

color_win_inactive_cur_sel_bg (gray) [Color]

Background color of the selected row which is also the currently playing track in inactive window.

color_win_inactive_cur_sel_fg (lightyellow) [Color]

Foreground color of the selected row which is also the currently playing track in inactive window.

color_win_inactive_sel_bg (gray) [Color]

Background color of selected row in inactive window.

color_win_inactive_sel_fg (black) [Color]

Foreground color of selected row in inactive window.

color_win_sel_bg (blue) [Color]

Background color of selected row in active window.

color_win_sel_fg (white) [Color]

Foreground color of selected row in active window.

color_win_title_bg (blue) [Color]

Background color of window titles (topmost line of the screen).

color_win_title_fg (white) [Color]

Foreground color of window titles (topmost line of the screen).

confirm_run (true)

Ask for confirmation before executing :run

continue (true)

Continue playing after current track finishes.

format_current [Format String]

Format string for the line displaying currently playing track.

format_playlist [Format String]

Format string for the list views (2-4).

format_title [Format String]

Format string for terminal tittle.
NOTE: not all terminals support changing window title.

format_trackwin [Format String]

Format string for the tree view's (1) track window.

id3_default_charset (ISO-8859-1)

Default character set to use for ID3v1 and broken ID3v2 tags.
NOTE: This is used only if the tag is not valid UTF-8.

lib_sort (artist album discnumber tracknumber title filename) [Sort Keys]

Sort keys for the sorted library view (2).

output_plugin [alsa, arts, oss, sun]

Name of output plugin.

pl_sort () [Sort Keys]

Sort keys for the playlist view (3). Empty value disables sorting and enables manually moving tracks.

play_library (true)

Play tracks from the library instead of playlist.

play_sorted (false)

Play tracks from the library in the sorted view (2) order instead of tree view (1) order. Used only when play_library is true.

repeat (false)

Repeat after all tracks played.

replaygain (false)

Enable Replay Gain.

replaygain_limit (true)

Use replay gain limiting when clipping.

replaygain_preamp (6.0)

Replay gain preamplification in decibels.

show_hidden (false)

Display hidden files in browser.

show_remaining_time (false)

Display remaining time instead of elapsed time.

shuffle (false)

Play in shuffled order. Shuffle works in the library views (1-2) and playlist view (3).

softvol (false)

Use software volume control.
NOTE: You should probably set this to false when using ao as output_plugin to output to wav files.

softvol_state (100 100)

Used to save left and right channel values for software volume control. Two integers in range 0..100 separated by a space. This option is not usually changed directly since vol command does same thing if softvol is true.

status_display_program () [command]

This command, if not empty, is run every time cmus' status changes. It can be used to display currently playing track on desktop background or panel for example. See /usr/share/doc/cmus/examples/cmus-status-display.

Colors

Color is integer in range -1..255.

The following color names are recognized:

Terminal's default color, -1

default

Fg & bg, 0..7

black, red, green, yellow, blue, magenta, cyan, gray

Fg, 8..15

darkgray, lightred, lightgreen, lightyellow, lightblue, lightmagenta, lightcyan, white

Format Strings

Format strings control display of tracks in library, playlist and play queue views.

NOTE: altformat_* options are used when there are no tags available.

Special Characters:

%a
artist
%l
album
%D
disc number
%n
track number
%t
title
%g
genre
%y
year
%d
duration
%f
path and filename
%F
filename
%=
start align right (use at most once)
%%
literal %

You can use printf style formatting (width, alignment, padding). To see current value of an option type :set option=<TAB>.

Examples:

 :set format_trackwin= %02n. %t (%y)%= %d
 :set format_current= %n. %-30t %40F (%y)%= %d
 

Sort Keys

Sort option (lib_sort, pl_sort) value is space separated list of the following sort keys:
artist, album, title, tracknumber, discnumber, date, genre, filename

PLUGIN OPTIONS

dsp.alsa.device
PCM device for ALSA plugin, usually "default".

mixer.alsa.channel

Mixer channel for ALSA Plugin, usually "pcm", "master" or "headphone". To see all possible values run "alsamixer" or "amixer".

mixer.alsa.device

Mixer device for ALSA plugin, usually "default".

dsp.ao.buffer_size

Buffer size, default is 8192 but you may want to try bigger values if you experience buffer under-runs.

dsp.ao.driver

Output driver for libao plugin. Example values: "alsa09", "esd", "irix", "oss", "sun", "aixs", "wav".
NOTE: of the file output drivers only "wav" is supported.

dsp.ao.wav_counter

Counter used for making filename. Used only if dsp.ao.driver is "wav". For example if this is 1 and dsp.ao.wav_dir is "/home/user" then PCM data is outputted to "/home/user/01.wav". This counter is incremented every time playback is stopped.
NOTE: you probably want to set continue to false (press C), otherwise playback is not stopped between tracks and all PCM data is outputted to one wav file (useful if you want to join files). Also unsetting shuffle and repeat might be good idea.

dsp.ao.wav_dir

Output directory for libao plugin, default is your home directory. Used only if dsp.ao.driver is "wav".

dsp.oss.device

PCM device for OSS plugin, usually /dev/dsp.

mixer.oss.channel

Mixer channel for OSS Plugin, "pcm" or "master".

mixer.oss.device

Mixer device for OSS plugin, usually /dev/mixer.

dsp.sun.device

PCM device for Sun plugin, usually /dev/audio.

mixer.sun.channel

Mixer channel for Sun Plugin, usually "master".

mixer.sun.device

Mixer device for Sun plugin, usually /dev/mixer.

FILTERS

Filters are used mostly for filtering contents of library views (1 & 2). Filters do not change the actual library content, i.e. :save command will still save all tracks to playlist file whether they are visible or not.

Syntax

Filter expression is list of built-in filters or user defined filters separated with & (and) or | (or). Parenthesis can be used group subexpressions and ! negates result of the expression following it.

Strings

filename, artist, album, title, genre

Comparators: = and != (not equal)

Integers

discnumber, tracknumber, date (year), duration (seconds)

Comparators: <, <=, =, >=, >, !=

Booleans

tag (true if track has tags), stream (true if track is a stream)

Defining Filters

Filters can be defined with fset command. User defined filters appear in the filters view (6).

Create a new filter which name is ogg and value filename="*.ogg"

:fset ogg=filename="*.ogg"

Filter ogg and mp3 files from the 90s. Note the use of user defined filter ogg

:fset 90s-ogg-mp3=date>=1990&date<2000&(ogg|filename="*.mp3")

Activating Filters

factivate changes visible contents of the library (views 1-2).

Activate user defined filters ogg and missing-tags

:factivate ogg missing-tags

Like above but negate value of ogg filter.

:factivate !ogg missing-tags

Alternatively you can select the filters by pressing space in view 6 and then activate the selected filters by pressing enter.

Throw-away Filters

filter command is useful when you want to use a filter only once and not save it. It changes visible contents of the library (views 1-2) and unactivates all filters in the filters view.

Filter all rock (anything with rock in genre tag) music from 80s-

:filter date>=1980&genre="*rock*"

Selecting Tracks Matching a Filter

Mark (select) all tracks with duration less than 2 minutes
:mark duration<120

This command works in views 2-4.

FILES

cmus reads its configuration from 3 different places.

~/.cmus/autosave

This is the first file cmus loads. cmus saves its state on exit to this file so you shouldn't edit it.

/usr/share/cmus/rc

If the autosave file didn't exist, this file is read instead.

~/.cmus/rc

Static config file. This file is read immediately after the autosave file, and is never modified by cmus. You can override auto-saved settings in this file. This file is not limited to options, it can contain other commands too.

Color Schemes

There are some color schemes (*.theme) in /usr/share/cmus. You can switch them using the :colorscheme command. You can put your own color schemes to ~/.cmus.

Examples

Example status display script (See status_display_program option) can be found in /usr/share/doc/cmus/examples.

BUGS

After a crash last lines of /tmp/cmus-debug (or $TMPDIR/cmus-debug) might contain useful information. The file exists only if you configured cmus with maximum debug level (./configure DEBUG=2).

Feature requests and bug reports should go to the cmus-devel mailing list:

http://lists.sourceforge.net/lists/listinfo/cmus-devel

SEE ALSO

cmus-remote(1)

AUTHORS

cmus was mainly written by Timo Hirvonen <tihirvon@gmail.com>. Other contributers are listed in the AUTHORS file.

This man page was written by Frank Terbeck <ft@bewatermyfriend.org>, Timo Hirvonen <tihirvon@gmail.com>, and Clay Barnes <clay.barnes@gmail.com>.