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 play
58 Start or resume the playback.
59 .It Cm pause
60 Pause the playback.
61 .It Cm toggle
62 Play/pause the playback.
63 .It Cm stop
64 Stop the music player.
65 .It Cm restart
66 Rewind the current song to the beginning.
67 .It Cm add Ar
68 Enqueue the given files.
69 .It Cm flush
70 Erase the playlist.
71 .It Cm show Op Fl p
72 Print the current playlist.
73 With
74 .Fl p
75 it prints a
76 .Dq pretty
77 list with the current playing song prefixed by
78 .Sq > \&
79 .It Cm status
80 Print playback status and current song.
81 .It Cm next
82 Play the next song.
83 .It Cm prev
84 Play the previous song.
85 .It Cm load Op Ar file
86 Load a playlist from
87 .Ar file ,
88 which has one song per line.
89 If not specified, reads from
90 .Em stdin .
91 .El
92 .Pp
93 Commands can be also abbreviated to the smallest unique prefix,
94 so that for example
95 .Sq re
96 can be given instead of
97 .Sq restart .
98 .Sh FILES
99 .Bl -tag -width "/tmp/amused-$UID" -compact
100 .It Pa /tmp/amused-$UID
101 UNIX-domain socket used for communication with the daemon.
102 .El
103 .Sh EXAMPLES
104 Enqueue all mp3 files in the current directory:
105 .Bd -literal -offset indent
106 $ amused add *.mp3
107 .Ed
108 .Pp
109 Recursively add all opus files:
110 .Bd -literal -offset indent
111 $ find . -type f -iname \\*.opus -exec amused add {} +
112 .Ed
113 .Pp
114 Save the state of the player to the file
115 .Pa state :
116 .Bd -literal -offset indent
117 $ amused show > state
118 .Ed
119 .Pp
120 Load a previous state:
121 .Bd -literal -offset indent
122 $ amused load < state
123 .Ed
124 .Pp
125 Randomize the current playlist:
126 .Bd -literal -offset indent
127 $ amused show | sort -R | amused load
128 .Ed
129 .Pp
130 Remove duplicates:
131 .Bd -literal -offset indent
132 $ amused show | sort | uniq | amused load
133 .Ed
134 .Sh AUTHORS
135 .An -nosplit
136 Then
137 .Nm
138 utility was written by
139 .An Omar Polo Aq Mt op@openbsd.org .