Something Like The Plumber

I’ve never used it directly but the examples I’ve seen of Plan 9’s plumber in action make it seem easy to use and insanely helpful. The internals are a mystery to me but from a UI perspective it looks a lot like a launcher (such as dmenu or Quicksilver) that acts on selected text, and from a conceptual perspective seems a lot like pipes. Basically, you select some text and click some mouse key chord—the selected text gets piped into some set of rules and, if it passes all the checks, gets sent on to some action, which then does whatever you want with it.

So I wrote a little collection of scripts that, together, create functionality that’s something like the plumber. It relies on:

It’s very simple:

i3 plumber screenshot

In this screenshot, the part bordered in blue shows four files:

The bar in Acme colors up on top is dmenu rendered with the colors, prompt, etc., specified in the plumber-list-scripts script.

And the block beneath the part bordered in blue is the result of calling the dictionary script with the highlighted text, in this case the “plumber” highlighted in blue.

I’ve only tried this in i3 but it should be more or less trivial to set up in any Linux desktop or window manager.