Blob


1 .\" Copyright (c) 2022 Omar Polo <op@openbsd.org>
2 .\"
3 .\" Permission to use, copy, modify, and distribute this software for any
4 .\" purpose with or without fee is hereby granted, provided that the above
5 .\" copyright notice and this permission notice appear in all copies.
6 .\"
7 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 .\"
15 .Dd May 10, 2022
16 .Dt AMUSED 1
17 .Os
18 .Sh NAME
19 .Nm amused
20 .Nd music player
21 .Sh SYNOPSIS
22 .Nm
23 .Op Fl dv
24 .Op Fl s Ar socket
25 .Oo
26 .Ar command
27 .Op Ar argument ...
28 .Oc
29 .Sh DESCRIPTION
30 .Nm
31 is a music player daemon and command-line utility to plays music.
32 The server is started automatically in the background on demand.
33 .Pp
34 The following options are available:
35 .Bl -tag -width Ds
36 .It Fl d
37 Do not daemonize if starting the daemon:
38 .Nm
39 will run in the foreground and log to standard error.
40 It's ignored if any commands are given on the command line or if the
41 server is already running.
42 .It Fl v
43 Produce more verbose output.
44 .It Fl s Ar socket
45 Use
46 .Ar socket
47 instead of the default
48 .Pa /tmp/amused-$UID
49 to communicate with the daemon.
50 .It Ar command Op Ar argument ...
51 Specify the command to run.
52 If no commands are specified,
53 .Ic status
54 is assumed.
55 .El
56 .Pp
57 The following commands are available:
58 .Bl -tag -width 12m
59 .It Cm add Ar
60 Enqueue the given files.
61 .It Cm flush
62 Erase the playlist.
63 .It Cm jump Ar pattern
64 Play the first song in the playing queue that matches
65 .Ar pattern
66 .Pq a basic case-insensitive regexp .
67 .It Cm load Op Ar file
68 Load a playlist from
69 .Ar file
70 or standard input.
71 A playlist is a list of paths to music files given one per line
72 and optionally prefixed by
73 .Sq > \&
74 or two spaces.
75 If the list was generated by
76 .Nm
77 .Ic show Fl p
78 restores also the position in the playlist, otherwise if already playing
79 something tries to match the currently playing song in the new list.
80 Failing that, the playlist will be played from the first track onwards.
81 .It Cm monitor
82 Stop indefinitely and print the events as they happen one per line.
83 The events are triggered either by other instances of
84 .Nm
85 issuing commands or the player itself anvancing through the playing
86 queue.
87 .It Cm next
88 Play the next song.
89 .It Cm pause
90 Pause the playback.
91 .It Cm play
92 Start or resume the playback.
93 .It Cm prev
94 Play the previous song.
95 .It Cm repeat one|all on|off
96 Enable or disable the automatic repetition of the current track
97 .Pq Cm one
98 or of the whole playing queue
99 .Pq Cm all .
100 .It Cm restart
101 Rewind the current song to the beginning.
102 .It Cm show Op Fl p
103 Print the current playlist.
104 With
105 .Fl p
106 it prints a
107 .Dq pretty
108 list with the current playing song prefixed by
109 .Sq > \& .
110 .It Cm status
111 Print playback status and current song.
112 .It Cm stop
113 Stop the music player.
114 .It Cm toggle
115 Play/pause the playback.
116 .El
117 .Pp
118 Commands can be abbreviated to the smallest unique prefix, for example
119 .Sq rep
120 can be given instead of
121 .Sq repeat .
122 .Sh FILES
123 .Bl -tag -width "/tmp/amused-$UID" -compact
124 .It Pa /tmp/amused-$UID
125 .Ux Ns -domain
126 socket used for communication with the daemon.
127 .El
128 .Sh EXAMPLES
129 Enqueue all mp3 files in the current directory:
130 .Bd -literal -offset indent
131 $ amused add *.mp3
132 .Ed
133 .Pp
134 Recursively add all opus files:
135 .Bd -literal -offset indent
136 $ find . -type f -iname \\*.opus -exec amused add {} +
137 .Ed
138 .Pp
139 Save the state of the player to the file
140 .Pa state :
141 .Bd -literal -offset indent
142 $ amused show -p > state
143 .Ed
144 .Pp
145 Load a previous state:
146 .Bd -literal -offset indent
147 $ amused load < state
148 .Ed
149 .Pp
150 Shuffle the playlist:
151 .Bd -literal -offset indent
152 $ amused show | sort -R | amused load
153 .Ed
154 .Pp
155 Remove duplicates:
156 .Bd -literal -offset indent
157 $ amused show | sort | uniq | amused load
158 .Ed
159 .Pp
160 Select a song with
161 .Xr fzf 1
162 .Bd -literal -offset indent
163 $ amused jump "$(amused show | fzf +s)"
164 .Ed
165 .Sh AUTHORS
166 .An -nosplit
167 Then
168 .Nm
169 utility was written by
170 .An Omar Polo Aq Mt op@openbsd.org .