NAME
amused
—
music player
SYNOPSIS
amused |
[-dv ] [-s
socket] [command
[argument ...]] |
DESCRIPTION
amused
is a music player daemon and
command-line utility to play music. The server is started automatically in
the background on demand.
The following options are available:
-d
- Do not daemonize:
amused
will run in the foreground and log to standard error. It's ignored if any commands are given on the command line or if the server is already running. -s
socket- Use socket instead of the default /tmp/amused-UID to communicate with the daemon.
-v
- Produce more verbose output.
- command [argument ...]
- Specify the command to run. If no commands are specified,
status
is assumed.
The following commands are available:
add
file ...- Enqueue the given files.
consume
[on
|off
]- Enable or disable the consume mode. When consume mode is enabled the tracks are removed from the playlist once played until the end. Without arguments toggle the current status.
flush
- Erase the playlist.
jump
pattern- Play the first song in the playing queue that matches pattern (a basic case-insensitive regexp).
load
[file]- Load a playlist from file or standard input. A
playlist is a list of paths to music files given one per line and
optionally prefixed by ‘> ’ or two spaces. If the list
was generated by
amused
show
-p
restore also the position in the playlist. Otherwise, if already playing something, try to match the currently song in the new list. Failing that, the playlist will be played from the first track onwards. monitor
[events]- Stop indefinitely and print when an event in the comma-separated list of
events happened, or all if not given. The available
events are:
- add
- Added a song to the playlist.
- jump
- Jumped to a different song in the playlist.
- load
- Loaded a new playlist.
- mode
- Mode changed (repeat or consume).
- next
- Advanced to next song.
- pause
- Paused.
- play
- Playing or resuming a song.
- prev
- Gone back to previous song.
- seek
- Seeked in the current track.
- stop
- Stopped.
next
- Play the next song.
pause
- Pause the playback.
play
- Start or resume the playback.
prev
- Play the previous song.
repeat one
|all
[on
|off
]- Enable or disable the automatic repetition of the current track
(
one
) or of the whole playing queue (all
). Without arguments toggle the given repeat mode. restart
- Rewind the current song to the beginning. It's a shorthand for
amused
seek
0. seek
[[hours:]minutes:]seconds | percentage%- Seek by the specified amount of time into the current song. If the argument is prefixed by either ‘+’ or ‘-’ then the seek is relative to the current position.
show
[-p
]- Show the playlist. With
-p
it prints a “pretty” list with the current playing song prefixed by ‘> ’. status
[-f
format]- Print playback status and current song. The format
is a comma-separated list of words that select the information to print,
in order. It defaults to
AMUSED_STATUS_FORMAT
or to “status,time:oneline,mode:oneline” if not defined. The formats available are:- path
- Path of the current song
- mode:oneline
- Mode status in a single line.
- mode
- Repeat all, one and consume, one per line.
- status
- Playback status by the path to the current song.
- time:oneline
- Position and duration in a single line.
- time:percentage
- Percentage of the current position.
- time:raw
- Current position and duration in seconds.
- time
- Current position and duration in a human-readable format.
stop
- Stop the playback.
toggle
- Play/pause the playback.
Commands can be abbreviated to a unique prefix, for example ‘rep’ can be given instead of ‘repeat’.
amused
automatically skips and removes
from the playlist non-regular files or ones with a non-recognized audio
format.
ENVIRONMENT
AMUSED_STATUS_FORMAT
- The default format used by
amused
status
. TEMPDIR
- Path to the directory where the control socket is created. Defaults to /tmp.
FILES
- /tmp/amused-UID
- UNIX-domain socket used for communication with the daemon.
EXAMPLES
Load every file under the current directory recursively:
$ find . | amused load
Enqueue all mp3 files in the current directory:
$ amused add *.mp3
Recursively add all opus files:
$ find . -type f -iname \*.opus -exec amused add {} +
Save the state of the player to the file amused.dump:
$ amused show -p > amused.dump
Load a previous state:
$ amused load < amused.dump
Shuffle the playlist:
$ amused show | sort -R | amused load
Remove duplicates:
$ amused show | sort | uniq | amused load
Select a song with fzf(1)
$ amused jump "$(amused show | fzf +s)"
AUTHORS
The amused
utility was written by
Omar Polo
<op@omarpolo.com>.