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 3, 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 case-insensitive regexp .
64 .It Cm load Op Ar file
65 Load a playlist from
66 .Ar file
67 or standard input.
68 A playlist is a list of paths to music files one per line optionally
69 prefixed by
70 .Sq > \&
71 or two spaces.
72 If the list was generated by
73 .Nm
74 .Ic show Fl p
75 restores also the currently playing song.
76 .It Cm monitor
77 Stop indefinitely and print the events as happen.
78 Events are print one per line and are triggered either by other
79 instances of
80 .Nm
81 issuing commands or the player itself anvancing the playing queue.
82 .It Cm next
83 Play the next song.
84 .It Cm pause
85 Pause the playback.
86 .It Cm play
87 Start or resume the playback.
88 .It Cm prev
89 Play the previous song.
90 .It Cm repeat one|all on|off
91 Enable or disable the repetition of the current track
92 .Pq Cm one
93 or of the playing queue
94 .Pq Cm all .
95 .It Cm restart
96 Rewind the current song to the beginning.
97 .It Cm show Op Fl p
98 Print the current playlist.
99 With
100 .Fl p
101 it prints a
102 .Dq pretty
103 list with the current playing song prefixed by
104 .Sq > \& .
105 .It Cm status
106 Print playback status and current song.
107 .It Cm stop
108 Stop the music player.
109 .It Cm toggle
110 Play/pause the playback.
111 .El
112 .Pp
113 Commands can be abbreviated to the smallest unique prefix, for example
114 .Sq rep
115 can be given instead of
116 .Sq repeat .
117 .Sh FILES
118 .Bl -tag -width "/tmp/amused-$UID" -compact
119 .It Pa /tmp/amused-$UID
120 .Ux Ns -domain
121 socket used for communication with the daemon.
122 .El
123 .Sh EXAMPLES
124 Enqueue all mp3 files in the current directory:
125 .Bd -literal -offset indent
126 $ amused add *.mp3
127 .Ed
128 .Pp
129 Recursively add all opus files:
130 .Bd -literal -offset indent
131 $ find . -type f -iname \\*.opus -exec amused add {} +
132 .Ed
133 .Pp
134 Save the state of the player to the file
135 .Pa state :
136 .Bd -literal -offset indent
137 $ amused show -p > state
138 .Ed
139 .Pp
140 Load a previous state:
141 .Bd -literal -offset indent
142 $ amused load < state
143 .Ed
144 .Pp
145 Randomize the current playlist:
146 .Bd -literal -offset indent
147 $ amused show | sort -R | amused load
148 .Ed
149 .Pp
150 Remove duplicates:
151 .Bd -literal -offset indent
152 $ amused show | sort | uniq | amused load
153 .Ed
154 .Pp
155 Select a song with
156 .Xr fzf 1
157 .Bd -literal -offset indent
158 $ amused jump "$(amused show | fzf +s)"
159 .Ed
160 .Sh AUTHORS
161 .An -nosplit
162 Then
163 .Nm
164 utility was written by
165 .An Omar Polo Aq Mt op@openbsd.org .
166 .Sh BUGS
167 .Nm
168 looks at the file name to determine the file type,
169 .Xr magic 5
170 should be used instead.