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