shithub: plumbto

Download patch

ref: cf51a63bb605f03b5a3bd528a2a1725e42c3f7d0
parent: 891d581afe56da04cffbd812fe486e465e52affe
author: sirjofri <sirjofri@sirjofri.de>
date: Fri Dec 11 17:33:42 EST 2020

removes old readme, adds samplerules, adds man-readme

see samplerules for sample configuration. see (rendered) man page for usage info

--- /dev/null
+++ b/README
@@ -1,0 +1,33 @@
+
+     PLUMBTO(1)                                             PLUMBTO(1)
+
+     NAME
+          plumbto - select plumb destination channel
+
+     SYNOPSIS
+          plumbto
+
+     DESCRIPTION
+          Plumbto listens on the chanselect plumb channel for messages
+          containing the channels attribute.  It then presents a but-
+          ton for each destination channel in the comma-separated list
+          provided as a value for the channels attribute.
+
+          After selection, the channels attribute is removed and the
+          message is forwarded to the selected port.
+
+          Plumbto hides itself on startup.  It unhides automatically
+          when receiving a message.
+
+     SOURCE
+          /sys/src/cmd/plumbto.c
+
+     SEE ALSO
+          plumb(1), plumb(6), plumber(4)
+
+     BUGS
+          No.
+
+     HISTORY
+          Plumbto first appeared in 9front… maybe.
+
--- a/README.md
+++ /dev/null
@@ -1,13 +1,0 @@
-# plumbto
-
-*aka: Make plumber usable with multiple destination channels without changing plumb links too much.*
-
-This application provides a GUI for selecting the destination channel for plumb messages.
-
-The incoming plumb messages need to be sent to the `chanselect` channel.
-They also need to contain a valid `channels` attribute with a comma separated list of possible destination channels.
-
-To combine this in a plumb command: `plumb -d chanselect -a 'channels=chan1,chan2'`.
-
-Of course the channel(s) must exist.
-You can run `echo plumb to chanselect >> /mnt/plumb/rules` to create the chanselect channel.
--- a/plumbto.man.txt
+++ /dev/null
@@ -1,33 +1,0 @@
-
-     PLUMBTO(1)                                             PLUMBTO(1)
-
-     NAME
-          plumbto - select plumb destination channel
-
-     SYNOPSIS
-          plumbto
-
-     DESCRIPTION
-          Plumbto listens on the chanselect plumb channel for messages
-          containing the channels attribute.  It then presents a but-
-          ton for each destination channel in the comma-separated list
-          provided as a value for the channels attribute.
-
-          After selection, the channels attribute is removed and the
-          message is forwarded to the selected port.
-
-          Plumbto hides itself on startup.  It unhides automatically
-          when receiving a message.
-
-     SOURCE
-          /sys/src/cmd/plumbto.c
-
-     SEE ALSO
-          plumb(1), plumb(6), plumber(4)
-
-     BUGS
-          No.
-
-     HISTORY
-          Plumbto first appeared in 9front… maybe.
-
--- /dev/null
+++ b/samplerules
@@ -1,0 +1,14 @@
+# sample /mnt/plumb/rules
+
+plumb to chanselect
+plumb to image
+plumb to imageedit
+
+type	is	text
+data	matches	'[a-zA-Z¡-￿0-9_\-.,/]+'
+data	matches	'([a-zA-Z¡-￿0-9_\-.,/]+)\.(jpe?g|JPE?G|gif|GIF|tiff?|TIFF?|ppm|PPM|bit|BIT|png|PNG|pgm|PGM|bmp|BMP|yuv|YUV)'
+arg	isfile	$0
+attr	add	channels=image,imageedit
+plumb	to	chanselect
+
+# have a listener on image and imageedit