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 March 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 that plays music
32 in the background.
33 The server is automatically started when the user interacts with
34 it.
35 .Pp
36 The following options are available:
37 .Bl -tag -width 12m
38 .It Fl d
39 Do not daemonize if starting the daemon:
40 .Nm
41 will run in the foreground and log to standard error.
42 It's ignored if any commands are given on the command line or if the
43 server was already running.
44 .It Fl v
45 Produce more verbose output.
46 .It Fl s Ar socket
47 Use
48 .Ar socket
49 instead of the default
50 .Pa /tmp/amused-$UID
51 to communicate with the daemon.
52 .It Ar command Op Ar argument ...
53 Specify the command to run.
54 If no commands are specified,
55 .Ic status
56 is assumed.
57 .El
58 .Pp
59 The following commands are available:
60 .Bl -tag -width 12m
61 .It Cm add Ar
62 Enqueue the given files.
63 .It Cm flush
64 Erase the playlist.
65 .It Cm jump Ar pattern
66 Play the first song in the playing queue that matches
67 .Ar pattern
68 .Pq a basic case-insensitive regexp .
69 .It Cm load Op Ar file
70 Load a playlist from
71 .Ar file
72 or standard input.
73 A playlist is a list of paths to music files one per line optionally
74 prefixed by
75 .Sq > \&
76 or two spaces.
77 If the list was generated by
78 .Nm
79 .Ic show Fl p
80 restores also the currently played song, otherwise tries to match it in
81 the new list.
82 .It Cm monitor
83 Stop indefinitely and print the events as happen.
84 Events are print one per line and are triggered either by other
85 instances of
86 .Nm
87 issuing commands or the player itself anvancing the playing queue.
88 .It Cm next
89 Play the next song.
90 .It Cm pause
91 Pause the playback.
92 .It Cm play
93 Start or resume the playback.
94 .It Cm prev
95 Play the previous song.
96 .It Cm repeat one|all on|off
97 Enable or disable the repetition of the current track
98 .Pq Cm one
99 or of the playing queue
100 .Pq Cm all .
101 .It Cm restart
102 Rewind the current song to the beginning.
103 .It Cm show Op Fl p
104 Print the current playlist.
105 With
106 .Fl p
107 it prints a
108 .Dq pretty
109 list with the current playing song prefixed by
110 .Sq > \& .
111 .It Cm status
112 Print playback status and current song.
113 .It Cm stop
114 Stop the music player.
115 .It Cm toggle
116 Play/pause the playback.
117 .El
118 .Pp
119 Commands can be abbreviated to the smallest unique prefix, for example
120 .Sq rep
121 can be given instead of
122 .Sq repeat .
123 .Sh FILES
124 .Bl -tag -width "/tmp/amused-$UID" -compact
125 .It Pa /tmp/amused-$UID
126 .Ux Ns -domain
127 socket used for communication with the daemon.
128 .El
129 .Sh EXAMPLES
130 Enqueue all mp3 files in the current directory:
131 .Bd -literal -offset indent
132 $ amused add *.mp3
133 .Ed
134 .Pp
135 Recursively add all opus files:
136 .Bd -literal -offset indent
137 $ find . -type f -iname \\*.opus -exec amused add {} +
138 .Ed
139 .Pp
140 Save the state of the player to the file
141 .Pa state :
142 .Bd -literal -offset indent
143 $ amused show -p > state
144 .Ed
145 .Pp
146 Load a previous state:
147 .Bd -literal -offset indent
148 $ amused load < state
149 .Ed
150 .Pp
151 Randomize the current playlist:
152 .Bd -literal -offset indent
153 $ amused show | sort -R | amused load
154 .Ed
155 .Pp
156 Remove duplicates:
157 .Bd -literal -offset indent
158 $ amused show | sort | uniq | amused load
159 .Ed
160 .Pp
161 Select a song with
162 .Xr fzf 1
163 .Bd -literal -offset indent
164 $ amused jump "$(amused show | fzf +s)"
165 .Ed
166 .Sh AUTHORS
167 .An -nosplit
168 Then
169 .Nm
170 utility was written by
171 .An Omar Polo Aq Mt op@openbsd.org .
172 .Sh BUGS
173 .Nm
174 looks at the file name to determine the file type,
175 .Xr magic 5
176 should be used instead.