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 18e7b0bb 2022-07-09 op .Dd July 9, 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 a6d90fb2 2022-05-10 op is a music player daemon and command-line utility to plays 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 3baa2617 2022-02-16 op .It Cm flush
62 3baa2617 2022-02-16 op Erase the playlist.
63 40aa47d9 2022-02-19 op .It Cm jump Ar pattern
64 40aa47d9 2022-02-19 op Play the first song in the playing queue that matches
65 40aa47d9 2022-02-19 op .Ar pattern
66 140010c2 2022-03-03 op .Pq a basic case-insensitive regexp .
67 ba7595d8 2022-02-17 op .It Cm load Op Ar file
68 ba7595d8 2022-02-17 op Load a playlist from
69 a1d30eac 2022-03-03 op .Ar file
70 a1d30eac 2022-03-03 op or standard input.
71 a6d90fb2 2022-05-10 op A playlist is a list of paths to music files given one per line
72 a6d90fb2 2022-05-10 op and optionally prefixed by
73 a1d30eac 2022-03-03 op .Sq > \&
74 a1d30eac 2022-03-03 op or two spaces.
75 a1d30eac 2022-03-03 op If the list was generated by
76 a1d30eac 2022-03-03 op .Nm
77 a1d30eac 2022-03-03 op .Ic show Fl p
78 a6d90fb2 2022-05-10 op restores also the position in the playlist, otherwise if already playing
79 a6d90fb2 2022-05-10 op something tries to match the currently playing song in the new list.
80 a6d90fb2 2022-05-10 op Failing that, the playlist will be played from the first track onwards.
81 90122a37 2022-05-14 op .It Cm monitor Op Ar events
82 90122a37 2022-05-14 op Stop indefinitely and print when an event in the comma-separated list of
83 90122a37 2022-05-14 op .Ar events
84 fea2a1d2 2022-07-12 op happened, or all if not given.
85 fea2a1d2 2022-07-12 op The available
86 90122a37 2022-05-14 op .Ar events
87 fea2a1d2 2022-07-12 op are:
88 fea2a1d2 2022-07-12 op .Pp
89 fea2a1d2 2022-07-12 op .Bl -tag -compact -width unknown
90 fea2a1d2 2022-07-12 op .It play
91 fea2a1d2 2022-07-12 op Playing or resuming a song.
92 fea2a1d2 2022-07-12 op .It pause
93 fea2a1d2 2022-07-12 op Paused.
94 fea2a1d2 2022-07-12 op .It stop
95 fea2a1d2 2022-07-12 op Stopped.
96 fea2a1d2 2022-07-12 op .It next
97 fea2a1d2 2022-07-12 op Advanced to next song.
98 fea2a1d2 2022-07-12 op .It prev
99 fea2a1d2 2022-07-12 op Gone back to previous song.
100 fea2a1d2 2022-07-12 op .It jump
101 fea2a1d2 2022-07-12 op Jumped to a different song in the playlist.
102 fea2a1d2 2022-07-12 op .It add
103 fea2a1d2 2022-07-12 op Added a song to the playlist.
104 fea2a1d2 2022-07-12 op .It load
105 fea2a1d2 2022-07-12 op Loaded a new playlist.
106 fea2a1d2 2022-07-12 op .It seek
107 fea2a1d2 2022-07-12 op Seeked in the current track.
108 fea2a1d2 2022-07-12 op .It unknown
109 fea2a1d2 2022-07-12 op An unknown event.
110 fea2a1d2 2022-07-12 op .El
111 40aa47d9 2022-02-19 op .It Cm next
112 40aa47d9 2022-02-19 op Play the next song.
113 40aa47d9 2022-02-19 op .It Cm pause
114 40aa47d9 2022-02-19 op Pause the playback.
115 40aa47d9 2022-02-19 op .It Cm play
116 40aa47d9 2022-02-19 op Start or resume the playback.
117 40aa47d9 2022-02-19 op .It Cm prev
118 40aa47d9 2022-02-19 op Play the previous song.
119 3ec4f99d 2022-02-19 op .It Cm repeat one|all on|off
120 a6d90fb2 2022-05-10 op Enable or disable the automatic repetition of the current track
121 3ec4f99d 2022-02-19 op .Pq Cm one
122 a6d90fb2 2022-05-10 op or of the whole playing queue
123 3ec4f99d 2022-02-19 op .Pq Cm all .
124 40aa47d9 2022-02-19 op .It Cm restart
125 40aa47d9 2022-02-19 op Rewind the current song to the beginning.
126 18e7b0bb 2022-07-09 op It's a shorthand for
127 18e7b0bb 2022-07-09 op .Nm
128 18e7b0bb 2022-07-09 op .Cm seek
129 18e7b0bb 2022-07-09 op .Ar 0 .
130 18e7b0bb 2022-07-09 op .It Cm seek Oo Oo Ar hours : Oc Ns Ar minutes : Oc Ns Ar seconds | Ar percentage Ns %
131 18e7b0bb 2022-07-09 op Seek by the specified amount of time into the current song.
132 18e7b0bb 2022-07-09 op If the argument is prefixed by either
133 18e7b0bb 2022-07-09 op .Sq +
134 18e7b0bb 2022-07-09 op or
135 18e7b0bb 2022-07-09 op .Sq -
136 18e7b0bb 2022-07-09 op then the seek is done relative to the current position.
137 40aa47d9 2022-02-19 op .It Cm show Op Fl p
138 40aa47d9 2022-02-19 op Print the current playlist.
139 40aa47d9 2022-02-19 op With
140 40aa47d9 2022-02-19 op .Fl p
141 40aa47d9 2022-02-19 op it prints a
142 40aa47d9 2022-02-19 op .Dq pretty
143 40aa47d9 2022-02-19 op list with the current playing song prefixed by
144 40aa47d9 2022-02-19 op .Sq > \& .
145 57d97cc5 2022-07-10 op .It Cm status Op Fl f Ar format
146 40aa47d9 2022-02-19 op Print playback status and current song.
147 57d97cc5 2022-07-10 op The
148 57d97cc5 2022-07-10 op .Ar format
149 57d97cc5 2022-07-10 op is a comma-separated list of words that select the information to
150 57d97cc5 2022-07-10 op print, in order.
151 57d97cc5 2022-07-10 op It defaults to
152 57d97cc5 2022-07-10 op .Ev AMUSED_STATUS_FORMAT
153 57d97cc5 2022-07-10 op or to
154 57d97cc5 2022-07-10 op .Dq status,time,repeat
155 57d97cc5 2022-07-10 op if not defined.
156 57d97cc5 2022-07-10 op The format available are:
157 57d97cc5 2022-07-10 op .Pp
158 57d97cc5 2022-07-10 op .Bl -tag -compact -width time:percentage
159 57d97cc5 2022-07-10 op .It path
160 57d97cc5 2022-07-10 op Path of the current song
161 57d97cc5 2022-07-10 op .It repeat:oneline
162 57d97cc5 2022-07-10 op Repeat status in a single line.
163 57d97cc5 2022-07-10 op .It repeat
164 57d97cc5 2022-07-10 op Repeat all and repeat one status, one per line.
165 57d97cc5 2022-07-10 op .It status
166 57d97cc5 2022-07-10 op Playback status by the path to the current song.
167 57d97cc5 2022-07-10 op .It time:oneline
168 57d97cc5 2022-07-10 op Position and duration in a single line.
169 57d97cc5 2022-07-10 op .It time:percentage
170 57d97cc5 2022-07-10 op Percentage of the current position.
171 57d97cc5 2022-07-10 op .It time:raw
172 57d97cc5 2022-07-10 op Current position and duration in seconds.
173 57d97cc5 2022-07-10 op .It time
174 57d97cc5 2022-07-10 op Current position and duration in a human-readable format.
175 57d97cc5 2022-07-10 op .El
176 40aa47d9 2022-02-19 op .It Cm stop
177 40aa47d9 2022-02-19 op Stop the music player.
178 40aa47d9 2022-02-19 op .It Cm toggle
179 40aa47d9 2022-02-19 op Play/pause the playback.
180 3baa2617 2022-02-16 op .El
181 cfb00927 2022-02-17 op .Pp
182 129b80cf 2022-07-09 op Commands can be abbreviated to a unique prefix, for example
183 b25bcbd1 2022-02-19 op .Sq rep
184 cfb00927 2022-02-17 op can be given instead of
185 b25bcbd1 2022-02-19 op .Sq repeat .
186 4d78a5af 2022-06-12 op .Pp
187 4d78a5af 2022-06-12 op .Nm
188 47e75b09 2022-07-10 op automatically skips and removes from the playlist non-regular files by
189 47e75b09 2022-07-10 op default.
190 47e75b09 2022-07-10 op Files with non recognized audio format are skippend and removed from
191 47e75b09 2022-07-10 op the playlist too.
192 57d97cc5 2022-07-10 op .Sh ENVIRONMENT
193 57d97cc5 2022-07-10 op .Bl -tag -width AMUSED_STATUS_FORMAT
194 57d97cc5 2022-07-10 op .It Ev AMUSED_STATUS_FORMAT
195 57d97cc5 2022-07-10 op The default format used by
196 57d97cc5 2022-07-10 op .Nm
197 57d97cc5 2022-07-10 op .Cm status .
198 57d97cc5 2022-07-10 op .El
199 3baa2617 2022-02-16 op .Sh FILES
200 3baa2617 2022-02-16 op .Bl -tag -width "/tmp/amused-$UID" -compact
201 3baa2617 2022-02-16 op .It Pa /tmp/amused-$UID
202 bf57ea43 2022-02-22 op .Ux Ns -domain
203 bf57ea43 2022-02-22 op socket used for communication with the daemon.
204 3baa2617 2022-02-16 op .El
205 2c35cd80 2022-02-17 op .Sh EXAMPLES
206 2c35cd80 2022-02-17 op Enqueue all mp3 files in the current directory:
207 2c35cd80 2022-02-17 op .Bd -literal -offset indent
208 2c35cd80 2022-02-17 op $ amused add *.mp3
209 2c35cd80 2022-02-17 op .Ed
210 2c35cd80 2022-02-17 op .Pp
211 2c35cd80 2022-02-17 op Recursively add all opus files:
212 2c35cd80 2022-02-17 op .Bd -literal -offset indent
213 2c35cd80 2022-02-17 op $ find . -type f -iname \\*.opus -exec amused add {} +
214 2c35cd80 2022-02-17 op .Ed
215 2c35cd80 2022-02-17 op .Pp
216 c1009d92 2022-06-12 op Load every file under the current directory recursively:
217 c1009d92 2022-06-12 op .Bd -literal -offset indent
218 c1009d92 2022-06-12 op $ find . | amused load
219 c1009d92 2022-06-12 op .Ed
220 c1009d92 2022-06-12 op .Pp
221 2c35cd80 2022-02-17 op Save the state of the player to the file
222 2c35cd80 2022-02-17 op .Pa state :
223 2c35cd80 2022-02-17 op .Bd -literal -offset indent
224 19dc5a22 2022-03-03 op $ amused show -p > state
225 2c35cd80 2022-02-17 op .Ed
226 2c35cd80 2022-02-17 op .Pp
227 2c35cd80 2022-02-17 op Load a previous state:
228 2c35cd80 2022-02-17 op .Bd -literal -offset indent
229 2c35cd80 2022-02-17 op $ amused load < state
230 2c35cd80 2022-02-17 op .Ed
231 19ae7661 2022-02-17 op .Pp
232 a6d90fb2 2022-05-10 op Shuffle the playlist:
233 19ae7661 2022-02-17 op .Bd -literal -offset indent
234 19ae7661 2022-02-17 op $ amused show | sort -R | amused load
235 19ae7661 2022-02-17 op .Ed
236 19ae7661 2022-02-17 op .Pp
237 19ae7661 2022-02-17 op Remove duplicates:
238 19ae7661 2022-02-17 op .Bd -literal -offset indent
239 19ae7661 2022-02-17 op $ amused show | sort | uniq | amused load
240 19ae7661 2022-02-17 op .Ed
241 99b9b3af 2022-02-17 op .Pp
242 99b9b3af 2022-02-17 op Select a song with
243 99b9b3af 2022-02-17 op .Xr fzf 1
244 99b9b3af 2022-02-17 op .Bd -literal -offset indent
245 99b9b3af 2022-02-17 op $ amused jump "$(amused show | fzf +s)"
246 99b9b3af 2022-02-17 op .Ed
247 3baa2617 2022-02-16 op .Sh AUTHORS
248 3baa2617 2022-02-16 op .An -nosplit
249 3baa2617 2022-02-16 op Then
250 3baa2617 2022-02-16 op .Nm
251 3baa2617 2022-02-16 op utility was written by
252 3baa2617 2022-02-16 op .An Omar Polo Aq Mt op@openbsd.org .