burncd.1 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. .\" burncd.1
  2. .\" Copyright 2018-2020 orbea
  3. .\" All rights reserved.
  4. .\"
  5. .\" Redistribution and use of this script, with or without modification, is
  6. .\" permitted provided that the following conditions are met:
  7. .\"
  8. .\" 1. Redistributions of this script must retain the above copyright
  9. .\" notice, this list of conditions and the following disclaimer.
  10. .\"
  11. .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  12. .\" WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  14. .\" EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  16. .\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  17. .\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  18. .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  19. .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  20. .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21. .\"
  22. .Dd September 27, 2020
  23. .Dt BURNCD 1
  24. .Os
  25. .Sh NAME
  26. .Nm burncd
  27. .Nd burn audio files to a blank CD
  28. .Sh SYNOPSIS
  29. .Nm
  30. .Op Fl dhnNvV
  31. .Op Fl c Ar config ...
  32. .Op Fl C Ar binary
  33. .Op Fl e Ar format ...
  34. .Op Fl f Ar format ...
  35. .Op Fl F Ar binary
  36. .Op Fl i Ar path ...
  37. .Op Fl M Ar binary
  38. .Op Fl o Ar path
  39. .Op Fl p Ar playlist ...
  40. .Op Fl S Ar binary
  41. .Op Fl z Ar device
  42. .Op Ar
  43. .Sh DESCRIPTION
  44. burncd is a portable POSIX shell script that uses
  45. .Xr cdrecord 1
  46. to burn audio files to a blank CD.
  47. It currently supports
  48. .Xr flac 1 ,
  49. wav, mp3 and Sun/NeXT audio files which will be automatically detected from the
  50. command line, current directory or playlist.
  51. .Ss AUDIO FORMATS
  52. By default
  53. .Nm
  54. will prefer wav and Sun/NeXT audio formats as
  55. .Xr cdrecord 1
  56. supports these files natively.
  57. It will then select other lossless and lossy audio formats.
  58. Lossy audio formats will always be the least preferred.
  59. If any files exist in multiple audio formats it will use only the first.
  60. .Pp
  61. Currently supported audio formats by
  62. .Nm :
  63. .Pp
  64. .Bl -tag -width <TAB><TAB> -offset indent -compact
  65. .It Cm wav
  66. WAVE
  67. .It Cm au
  68. Sun/NeXT
  69. .It Cm flac
  70. FLAC
  71. .It Cm mp3
  72. MPEG Audio Layer III
  73. .El
  74. .Ss AUDIO FILES
  75. Audio files will be detected from the command line, current directory or
  76. playlist using the sanitized output of
  77. .Xr file 1 .
  78. This avoids issues related to filenames that do not have a correct filename
  79. extension.
  80. .Ss NON-NATIVE CD AUDIO FILES
  81. Audio files must be 44.1 kHz, 16-bit and stereo to be correctly work on blank
  82. audio CDs.
  83. If
  84. .Xr sox 1
  85. is found in the user's $PATH then it will be used to convert any audio files
  86. that are not properly supported.
  87. If
  88. .Xr sox 1
  89. is not found then
  90. .Nm
  91. will exit early when any such files are detected.
  92. .Ss PLAYLISTS
  93. Audio files can be read from plaintext playlist files containing a list of
  94. files separated by newline characters.
  95. Relative paths will be read from the current directory.
  96. If the file or playlist is missing, cannot be read or the playlist is not a
  97. text file a warning will be printed.
  98. Comment lines are not supported.
  99. .Ss CDRECORD PERMISSIONS
  100. Some distributions will install
  101. .Xr cdrecord 1
  102. without suid permissions for security concerns which will require
  103. .Nm
  104. to be run as root.
  105. Alternatively the user can add suid permissions to
  106. .Xr cdrecord 1 .
  107. .Pp
  108. For example the following commands can be used.
  109. .Bd -literal -offset indent
  110. # chown root:somegroup /usr/bin/cdrecord
  111. # chmod 4710 /usr/bin/cdrecord
  112. .Ed
  113. .Pp
  114. The user should then make sure they belong to 'somegroup'.
  115. .Ss ENVIRONMENT VARIABLES
  116. .Nm
  117. supports the following environment variables.
  118. .Pp
  119. .Bl -tag -width <TAB><TAB><TAB> -offset indent -compact
  120. .It Ev XDG_CONFIG_HOME
  121. XDG base directory.
  122. .It Ev XDG_CONFIG_DIRS
  123. List of colon-separated directories.
  124. .El
  125. .Pp
  126. .Ev XDG_CONFIG_HOME
  127. defaults to
  128. .Pa $HOME/.config/burncd/burncd.conf .
  129. .Ev XDG_CONFIG_DIRS
  130. defaults to
  131. .Pa /etc/xdg/burncd/burncd.conf .
  132. .Ss CONFIGURATION FILES
  133. .Nm
  134. looks for configuration files in the following order.
  135. .Pp
  136. .Bl -enum -offset indent -compact
  137. .It
  138. .Pa $XDG_CONFIG_HOME/burncd/burncd.conf
  139. .It
  140. .Pa $HOME/.burncd.conf
  141. .It
  142. .Pa $XDG_CONFIG_DIRS/burncd/burncd.conf
  143. .It
  144. .Pa /etc/burncd.conf
  145. .It
  146. .Pa ./burncd.conf
  147. .El
  148. .Pp
  149. Configuration files are written in plain text.
  150. Comments begin with a #.
  151. Variables are split by whitespace and a =.
  152. All other whitespace is ignored.
  153. Variables can be set to either a file path, a list deliminated with spaces or
  154. enabled with 1.
  155. Any unset variables will be set to the default.
  156. .Pp
  157. .Nm
  158. will ignore any unlisted variables.
  159. .Pp
  160. .Bl -tag -width <TAB><TAB> -offset indent -compact
  161. .It Va CDRECORD
  162. Path of the
  163. .Xr cdrecord 1
  164. binary.
  165. .It Va DEBUG
  166. Enable debug output from external programs.
  167. .It Va DEVICE
  168. Path of the CD drive.
  169. .It Va DRYRUN
  170. Enable a test run without burning to a CD.
  171. .It Va EXCLUDE
  172. Exclude audio formats from being detected.
  173. .It Va FORMAT
  174. Preferred audio formats.
  175. .It Va FLAC
  176. Path of the
  177. .Xr flac 1
  178. binary.
  179. .It Va MPG123
  180. Path of the
  181. .Xr mpg123 1
  182. binary.
  183. .It Va OUTPUT
  184. Path of the output directory.
  185. .It Va SOX
  186. Path of the
  187. .Xr sox 1
  188. binary.
  189. .It Va VERBOSE
  190. Enable verbose logging.
  191. .El
  192. .Pp
  193. When loading configuration files with
  194. .Fl -config ,
  195. variables set in a config file can be overridden by being set again in any
  196. additional config files.
  197. .Sh OPTIONS
  198. A summary of the options is included below.
  199. .Bl -tag -width indent
  200. .It Fl c , -config Ar config ...
  201. Path of the configuration files.
  202. .It Fl C , -cdrecord Ar binary
  203. Path of the
  204. .Xr cdrecord 1
  205. binary.
  206. .It Fl d , -debug
  207. Show the debug output from external programs.
  208. .It Fl e , -exclude Ar format ...
  209. Configure the excluded audio formats.
  210. .It Fl f , -format Ar format ...
  211. Configure the default audio formats.
  212. .It Fl F , -flac Ar binary
  213. Path of the
  214. .Xr flac 1
  215. binary.
  216. .It Fl h , -help
  217. Show basic usage and a list of all options.
  218. .It Fl i , -input Ar path ...
  219. Configure the default directories path.
  220. This is a no-op when reading files from the command line, playlist or standard
  221. input.
  222. .Nm
  223. will search the current directory by default.
  224. .It Fl M , -mpg123 Ar binary
  225. Path of the
  226. .Xr mpg123 1
  227. binary.
  228. .It Fl n , -dry-run
  229. Enable a test run without burning to a CD.
  230. .Nm
  231. will not check for a blank CD under this mode.
  232. .It Fl N , -no-conf
  233. Do not load default configuration files.
  234. .It Fl o , -output Ar path
  235. Configure the output directory path.
  236. Defaults to
  237. .Pa /tmp/CD .
  238. .It Fl p , -playlist Ar playlist ...
  239. Read audio files from a playlist.
  240. .It Fl S , -sox Ar binary
  241. Path of the
  242. .Xr sox 1
  243. binary.
  244. .It Fl v , -verbose
  245. Show the verbose
  246. .Nm
  247. output.
  248. .It Fl V , -version
  249. Show the
  250. .Nm
  251. version number.
  252. .It Fl z , -device Ar device
  253. Configure the CD drive path.
  254. Defaults to
  255. .Pa /dev/sr0 .
  256. .El
  257. .Sh EXAMPLES
  258. .Bl -tag -width indent
  259. .It Nm
  260. Burn audio files from the current directory to a blank CD.
  261. .It Nm Ar
  262. Burn audio files from the command line to a blank CD.
  263. .It Nm Fl c Cm burncd.conf.1 burncd.conf.2
  264. Load the
  265. .Pa burncd.conf.1
  266. and
  267. .Pa burncd.conf.2
  268. configuration files from the command line.
  269. .It Nm Fl C Cm /usr/bin/cdrecord
  270. Use the
  271. .Pa /usr/bin/cdrecord
  272. binary.
  273. .It Nm Fl e Cm wav mp3
  274. Exclude all wav and mp3 audio files.
  275. .It Nm Fl f Cm flac mp3
  276. Prefer
  277. .Xr flac 1
  278. and then mp3 audio files.
  279. .It Nm Fl F Cm /usr/bin/flac
  280. Use the
  281. .Pa /usr/bin/flac
  282. binary.
  283. .It Nm Fl i Cm /tmp/dir1 /tmp/dir2
  284. Set the default directories to
  285. .Pa /tmp/dir1
  286. and
  287. .Pa /tmp/dir2 .
  288. .It Nm Fl M Cm /usr/bin/mpg123
  289. Use the
  290. .Pa /usr/bin/mpg123
  291. binary.
  292. .It Nm Fl o Cm /tmp
  293. Set the output directory path to
  294. .Pa /tmp .
  295. .It Nm Fl p Cm foo bar
  296. Read audio files from plaintext playlists titled
  297. .Pa foo
  298. and
  299. .Pa bar .
  300. .It Nm Fl S Cm /usr/bin/sox
  301. Use the
  302. .Pa /usr/bin/sox
  303. binary.
  304. .It Nm Fl z Cm /dev/sr1
  305. Set the CD drive path to
  306. .Pa /dev/sr1 .
  307. .It Nm Fl
  308. Read audio files from standard input.
  309. .El
  310. .Pp
  311. Example
  312. .Nm
  313. configuration file.
  314. .Bd -literal -offset indent
  315. # Set the cdrecord binary path
  316. CDRECORD = /usr/bin/cdrecord
  317. # Prefer flac and then wav audio formats
  318. FORMAT = flac wav
  319. # Set the output directory
  320. OUTPUT = /tmp
  321. # Enable verbose logging
  322. VERBOSE = 1
  323. .Ed
  324. .Sh SEE ALSO
  325. .Xr cdrecord 1 ,
  326. .Xr flac 1 ,
  327. .Xr mpg123 1 ,
  328. .Xr sox 1
  329. .Sh AUTHORS
  330. .An -nosplit
  331. .Bl -tag -width "orbea Aq orbea@riseup.net " -compact
  332. .It An orbea Aq Mt orbea@riseup.net
  333. .El
  334. .Sh BUGS
  335. Not all mp3 audio files are detected by
  336. .Nm .
  337. .Pp
  338. .Lk https://notabug.org/orbea/burncd/issues "Issue tracker"