Blame


1 3baa2617 2022-02-16 op .\" Copyright (c) 2022 Omar Polo <op@openbsd.org>
2 3baa2617 2022-02-16 op .\"
3 3baa2617 2022-02-16 op .\" Permission to use, copy, modify, and distribute this software for any
4 3baa2617 2022-02-16 op .\" purpose with or without fee is hereby granted, provided that the above
5 3baa2617 2022-02-16 op .\" copyright notice and this permission notice appear in all copies.
6 3baa2617 2022-02-16 op .\"
7 3baa2617 2022-02-16 op .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 3baa2617 2022-02-16 op .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 3baa2617 2022-02-16 op .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 3baa2617 2022-02-16 op .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 3baa2617 2022-02-16 op .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 3baa2617 2022-02-16 op .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 3baa2617 2022-02-16 op .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 3baa2617 2022-02-16 op .\"
15 d42a3617 2022-07-25 op .Dd July 25, 2022
16 3baa2617 2022-02-16 op .Dt AMUSED 1
17 3baa2617 2022-02-16 op .Os
18 3baa2617 2022-02-16 op .Sh NAME
19 3baa2617 2022-02-16 op .Nm amused
20 3baa2617 2022-02-16 op .Nd music player
21 3baa2617 2022-02-16 op .Sh SYNOPSIS
22 3baa2617 2022-02-16 op .Nm
23 3baa2617 2022-02-16 op .Op Fl dv
24 3baa2617 2022-02-16 op .Op Fl s Ar socket
25 1d673950 2022-03-03 op .Oo
26 3baa2617 2022-02-16 op .Ar command
27 3baa2617 2022-02-16 op .Op Ar argument ...
28 1d673950 2022-03-03 op .Oc
29 3baa2617 2022-02-16 op .Sh DESCRIPTION
30 3baa2617 2022-02-16 op .Nm
31 b557564c 2022-07-13 op is a music player daemon and command-line utility to play music.
32 a6d90fb2 2022-05-10 op The server is started automatically in the background on demand.
33 3baa2617 2022-02-16 op .Pp
34 3baa2617 2022-02-16 op The following options are available:
35 f474712b 2022-05-09 op .Bl -tag -width Ds
36 3baa2617 2022-02-16 op .It Fl d
37 b0d2a966 2022-05-19 op Do not daemonize:
38 3baa2617 2022-02-16 op .Nm
39 161abbe5 2022-03-03 op will run in the foreground and log to standard error.
40 1d673950 2022-03-03 op It's ignored if any commands are given on the command line or if the
41 a6d90fb2 2022-05-10 op server is already running.
42 3baa2617 2022-02-16 op .It Fl v
43 3baa2617 2022-02-16 op Produce more verbose output.
44 3baa2617 2022-02-16 op .It Fl s Ar socket
45 3baa2617 2022-02-16 op Use
46 3baa2617 2022-02-16 op .Ar socket
47 3baa2617 2022-02-16 op instead of the default
48 3baa2617 2022-02-16 op .Pa /tmp/amused-$UID
49 3baa2617 2022-02-16 op to communicate with the daemon.
50 1d673950 2022-03-03 op .It Ar command Op Ar argument ...
51 1d673950 2022-03-03 op Specify the command to run.
52 18282bc0 2022-03-09 op If no commands are specified,
53 1d673950 2022-03-03 op .Ic status
54 18282bc0 2022-03-09 op is assumed.
55 3baa2617 2022-02-16 op .El
56 3baa2617 2022-02-16 op .Pp
57 3baa2617 2022-02-16 op The following commands are available:
58 26caf091 2022-05-14 op .Bl -tag -width Ds
59 3baa2617 2022-02-16 op .It Cm add Ar
60 3baa2617 2022-02-16 op Enqueue the given files.
61 1eae758b 2022-07-13 op .It Cm consume Op Cm on|off
62 0682e5d3 2022-07-13 op Enable or disable the consume mode.
63 9fb94242 2022-07-13 op When consume mode is enabled the tracks are removed from the playlist
64 0682e5d3 2022-07-13 op once played until the end.
65 0682e5d3 2022-07-13 op Without arguments toggle the current status.
66 3baa2617 2022-02-16 op .It Cm flush
67 3baa2617 2022-02-16 op Erase the playlist.
68 40aa47d9 2022-02-19 op .It Cm jump Ar pattern
69 40aa47d9 2022-02-19 op Play the first song in the playing queue that matches
70 40aa47d9 2022-02-19 op .Ar pattern
71 140010c2 2022-03-03 op .Pq a basic case-insensitive regexp .
72 ba7595d8 2022-02-17 op .It Cm load Op Ar file
73 ba7595d8 2022-02-17 op Load a playlist from
74 a1d30eac 2022-03-03 op .Ar file
75 a1d30eac 2022-03-03 op or standard input.
76 a6d90fb2 2022-05-10 op A playlist is a list of paths to music files given one per line
77 a6d90fb2 2022-05-10 op and optionally prefixed by
78 a1d30eac 2022-03-03 op .Sq > \&
79 a1d30eac 2022-03-03 op or two spaces.
80 a1d30eac 2022-03-03 op If the list was generated by
81 a1d30eac 2022-03-03 op .Nm
82 a1d30eac 2022-03-03 op .Ic show Fl p
83 b557564c 2022-07-13 op restore also the position in the playlist.
84 b557564c 2022-07-13 op Otherwise, if already playing something, try to match the currently
85 b557564c 2022-07-13 op song in the new list.
86 b557564c 2022-07-13 op Failing that, the playlist will be played from the first track
87 b557564c 2022-07-13 op onwards.
88 90122a37 2022-05-14 op .It Cm monitor Op Ar events
89 b557564c 2022-07-13 op Stop indefinitely and print when an event in the comma-separated list
90 b557564c 2022-07-13 op of
91 90122a37 2022-05-14 op .Ar events
92 fea2a1d2 2022-07-12 op happened, or all if not given.
93 fea2a1d2 2022-07-12 op The available
94 90122a37 2022-05-14 op .Ar events
95 fea2a1d2 2022-07-12 op are:
96 fea2a1d2 2022-07-12 op .Pp
97 6242c160 2022-07-13 op .Bl -tag -compact -width Ds
98 fea2a1d2 2022-07-12 op .It add
99 fea2a1d2 2022-07-12 op Added a song to the playlist.
100 6242c160 2022-07-13 op .It jump
101 6242c160 2022-07-13 op Jumped to a different song in the playlist.
102 fea2a1d2 2022-07-12 op .It load
103 fea2a1d2 2022-07-12 op Loaded a new playlist.
104 9fb94242 2022-07-13 op .It mode
105 6242c160 2022-07-13 op Mode changed
106 9fb94242 2022-07-13 op .Pq repeat or consume .
107 6242c160 2022-07-13 op .It next
108 6242c160 2022-07-13 op Advanced to next song.
109 6242c160 2022-07-13 op .It pause
110 6242c160 2022-07-13 op Paused.
111 6242c160 2022-07-13 op .It play
112 6242c160 2022-07-13 op Playing or resuming a song.
113 6242c160 2022-07-13 op .It prev
114 6242c160 2022-07-13 op Gone back to previous song.
115 fea2a1d2 2022-07-12 op .It seek
116 fea2a1d2 2022-07-12 op Seeked in the current track.
117 6242c160 2022-07-13 op .It stop
118 6242c160 2022-07-13 op Stopped.
119 fea2a1d2 2022-07-12 op .El
120 40aa47d9 2022-02-19 op .It Cm next
121 40aa47d9 2022-02-19 op Play the next song.
122 40aa47d9 2022-02-19 op .It Cm pause
123 40aa47d9 2022-02-19 op Pause the playback.
124 40aa47d9 2022-02-19 op .It Cm play
125 40aa47d9 2022-02-19 op Start or resume the playback.
126 40aa47d9 2022-02-19 op .It Cm prev
127 40aa47d9 2022-02-19 op Play the previous song.
128 1eae758b 2022-07-13 op .It Cm repeat one|all Op Cm on|off
129 a6d90fb2 2022-05-10 op Enable or disable the automatic repetition of the current track
130 3ec4f99d 2022-02-19 op .Pq Cm one
131 a6d90fb2 2022-05-10 op or of the whole playing queue
132 3ec4f99d 2022-02-19 op .Pq Cm all .
133 0682e5d3 2022-07-13 op Without arguments toggle the given repeat mode.
134 40aa47d9 2022-02-19 op .It Cm restart
135 40aa47d9 2022-02-19 op Rewind the current song to the beginning.
136 18e7b0bb 2022-07-09 op It's a shorthand for
137 18e7b0bb 2022-07-09 op .Nm
138 18e7b0bb 2022-07-09 op .Cm seek
139 18e7b0bb 2022-07-09 op .Ar 0 .
140 18e7b0bb 2022-07-09 op .It Cm seek Oo Oo Ar hours : Oc Ns Ar minutes : Oc Ns Ar seconds | Ar percentage Ns %
141 18e7b0bb 2022-07-09 op Seek by the specified amount of time into the current song.
142 18e7b0bb 2022-07-09 op If the argument is prefixed by either
143 18e7b0bb 2022-07-09 op .Sq +
144 18e7b0bb 2022-07-09 op or
145 18e7b0bb 2022-07-09 op .Sq -
146 b557564c 2022-07-13 op then the seek is relative to the current position.
147 40aa47d9 2022-02-19 op .It Cm show Op Fl p
148 b557564c 2022-07-13 op Show the playlist.
149 40aa47d9 2022-02-19 op With
150 40aa47d9 2022-02-19 op .Fl p
151 40aa47d9 2022-02-19 op it prints a
152 40aa47d9 2022-02-19 op .Dq pretty
153 40aa47d9 2022-02-19 op list with the current playing song prefixed by
154 40aa47d9 2022-02-19 op .Sq > \& .
155 57d97cc5 2022-07-10 op .It Cm status Op Fl f Ar format
156 40aa47d9 2022-02-19 op Print playback status and current song.
157 57d97cc5 2022-07-10 op The
158 57d97cc5 2022-07-10 op .Ar format
159 57d97cc5 2022-07-10 op is a comma-separated list of words that select the information to
160 57d97cc5 2022-07-10 op print, in order.
161 57d97cc5 2022-07-10 op It defaults to
162 57d97cc5 2022-07-10 op .Ev AMUSED_STATUS_FORMAT
163 57d97cc5 2022-07-10 op or to
164 99bf1536 2022-07-13 op .Dq status,time:oneline,mode:oneline
165 57d97cc5 2022-07-10 op if not defined.
166 d42a3617 2022-07-25 op The formats available are:
167 57d97cc5 2022-07-10 op .Pp
168 57d97cc5 2022-07-10 op .Bl -tag -compact -width time:percentage
169 57d97cc5 2022-07-10 op .It path
170 57d97cc5 2022-07-10 op Path of the current song
171 dd4516c1 2022-07-13 op .It mode:oneline
172 dd4516c1 2022-07-13 op Mode status in a single line.
173 dd4516c1 2022-07-13 op .It mode
174 dd4516c1 2022-07-13 op Repeat all, one and consume, one per line.
175 57d97cc5 2022-07-10 op .It status
176 57d97cc5 2022-07-10 op Playback status by the path to the current song.
177 57d97cc5 2022-07-10 op .It time:oneline
178 57d97cc5 2022-07-10 op Position and duration in a single line.
179 57d97cc5 2022-07-10 op .It time:percentage
180 57d97cc5 2022-07-10 op Percentage of the current position.
181 57d97cc5 2022-07-10 op .It time:raw
182 57d97cc5 2022-07-10 op Current position and duration in seconds.
183 57d97cc5 2022-07-10 op .It time
184 57d97cc5 2022-07-10 op Current position and duration in a human-readable format.
185 57d97cc5 2022-07-10 op .El
186 40aa47d9 2022-02-19 op .It Cm stop
187 40aa47d9 2022-02-19 op Stop the music player.
188 40aa47d9 2022-02-19 op .It Cm toggle
189 40aa47d9 2022-02-19 op Play/pause the playback.
190 3baa2617 2022-02-16 op .El
191 cfb00927 2022-02-17 op .Pp
192 129b80cf 2022-07-09 op Commands can be abbreviated to a unique prefix, for example
193 b25bcbd1 2022-02-19 op .Sq rep
194 cfb00927 2022-02-17 op can be given instead of
195 b25bcbd1 2022-02-19 op .Sq repeat .
196 4d78a5af 2022-06-12 op .Pp
197 4d78a5af 2022-06-12 op .Nm
198 84856392 2022-07-13 op automatically skips and removes from the playlist non-regular files.
199 47e75b09 2022-07-10 op Files with non recognized audio format are skippend and removed from
200 47e75b09 2022-07-10 op the playlist too.
201 57d97cc5 2022-07-10 op .Sh ENVIRONMENT
202 57d97cc5 2022-07-10 op .Bl -tag -width AMUSED_STATUS_FORMAT
203 57d97cc5 2022-07-10 op .It Ev AMUSED_STATUS_FORMAT
204 57d97cc5 2022-07-10 op The default format used by
205 57d97cc5 2022-07-10 op .Nm
206 57d97cc5 2022-07-10 op .Cm status .
207 57d97cc5 2022-07-10 op .El
208 3baa2617 2022-02-16 op .Sh FILES
209 3baa2617 2022-02-16 op .Bl -tag -width "/tmp/amused-$UID" -compact
210 3baa2617 2022-02-16 op .It Pa /tmp/amused-$UID
211 bf57ea43 2022-02-22 op .Ux Ns -domain
212 bf57ea43 2022-02-22 op socket used for communication with the daemon.
213 3baa2617 2022-02-16 op .El
214 2c35cd80 2022-02-17 op .Sh EXAMPLES
215 84856392 2022-07-13 op Load every file under the current directory recursively:
216 84856392 2022-07-13 op .Bd -literal -offset indent
217 84856392 2022-07-13 op $ find . | amused load
218 84856392 2022-07-13 op .Ed
219 84856392 2022-07-13 op .Pp
220 2c35cd80 2022-02-17 op Enqueue all mp3 files in the current directory:
221 2c35cd80 2022-02-17 op .Bd -literal -offset indent
222 2c35cd80 2022-02-17 op $ amused add *.mp3
223 2c35cd80 2022-02-17 op .Ed
224 2c35cd80 2022-02-17 op .Pp
225 2c35cd80 2022-02-17 op Recursively add all opus files:
226 2c35cd80 2022-02-17 op .Bd -literal -offset indent
227 2c35cd80 2022-02-17 op $ find . -type f -iname \\*.opus -exec amused add {} +
228 2c35cd80 2022-02-17 op .Ed
229 2c35cd80 2022-02-17 op .Pp
230 2c35cd80 2022-02-17 op Save the state of the player to the file
231 2c35cd80 2022-02-17 op .Pa state :
232 2c35cd80 2022-02-17 op .Bd -literal -offset indent
233 19dc5a22 2022-03-03 op $ amused show -p > state
234 2c35cd80 2022-02-17 op .Ed
235 2c35cd80 2022-02-17 op .Pp
236 2c35cd80 2022-02-17 op Load a previous state:
237 2c35cd80 2022-02-17 op .Bd -literal -offset indent
238 2c35cd80 2022-02-17 op $ amused load < state
239 2c35cd80 2022-02-17 op .Ed
240 19ae7661 2022-02-17 op .Pp
241 a6d90fb2 2022-05-10 op Shuffle the playlist:
242 19ae7661 2022-02-17 op .Bd -literal -offset indent
243 19ae7661 2022-02-17 op $ amused show | sort -R | amused load
244 19ae7661 2022-02-17 op .Ed
245 19ae7661 2022-02-17 op .Pp
246 19ae7661 2022-02-17 op Remove duplicates:
247 19ae7661 2022-02-17 op .Bd -literal -offset indent
248 19ae7661 2022-02-17 op $ amused show | sort | uniq | amused load
249 19ae7661 2022-02-17 op .Ed
250 99b9b3af 2022-02-17 op .Pp
251 99b9b3af 2022-02-17 op Select a song with
252 99b9b3af 2022-02-17 op .Xr fzf 1
253 99b9b3af 2022-02-17 op .Bd -literal -offset indent
254 99b9b3af 2022-02-17 op $ amused jump "$(amused show | fzf +s)"
255 99b9b3af 2022-02-17 op .Ed
256 3baa2617 2022-02-16 op .Sh AUTHORS
257 3baa2617 2022-02-16 op .An -nosplit
258 3baa2617 2022-02-16 op Then
259 3baa2617 2022-02-16 op .Nm
260 3baa2617 2022-02-16 op utility was written by
261 3baa2617 2022-02-16 op .An Omar Polo Aq Mt op@openbsd.org .