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