shithub: bar

Download patch

ref: 2c1df4a0d69a2803023f870cff92f26492e689f0
parent: d0d3fda60557c179bfde73fe08eae76cc4ffaa67
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Fri Feb 19 08:18:27 EST 2021

man: provide an example of mouse click controls

--- a/bar.man
+++ b/bar.man
@@ -22,9 +22,11 @@
 standard input.
 .PP
 .I Bar
-Reacts to mouse clicks by writing the "clicked" portion of the text
+reacts to mouse clicks by writing the "clicked" portion of the text
 (enclosed by the separator) to standard output.  This can be used to
-perform additional actions by a custom script.
+perform additional actions by a custom script. See
+.I Examples
+section.
 .PP
 By default,
 .I bar
@@ -54,6 +56,29 @@
 .I -d
 option, see
 .I tmdate(2).
+.SH EXAMPLES
+An example of how
+.I bar
+can be used along with
+.I riow
+to control
+.I zuke
+playback via mouse clicks:
+.PP
+.EX
+#!/bin/rc
+rfork ne
+fn bar { sed -u 's/$/ │ ⏮ │ ⏯ │ ⏭/g' | /bin/bar | awk -v 'c=plumb -d audio ''key ' '
+	/⏮/{system(c"<''")}
+	/⏯/{system(c"p''")}
+	/⏭/{system(c">''")}
+ ' >[2]/dev/null }
+/bin/riow
+.EE
+.PP
+The script is executed instead of
+.I riow
+directly.
 .SH SOURCE
 https://git.sr.ht/~ft/bar
 .SH BUGS