README - plumb - Open certain URL patterns with an ad-hoc opener (plumber) (HTM) hg clone https://bitbucket.org/iamleot/plumb (DIR) Log (DIR) Files (DIR) Refs (DIR) README --- README --- 1 plumb is a shell script to open certain URL patterns with an ad-hoc 2 "opener". 3 4 The design of plumb is heavily inspired by Plumber written by 5 Christoph Lohmann, for more information about Plumber please see: 6 7 <http://r-36.net/scm/plumber/log.html> 8 9 To use `plumb` first the `${PLUMB_OPENERS_PATH}` (if not defined by 10 default it is `~/.plumb/openers`) and `${PLUMB_RULES}` (if not defined 11 by default it is `~/.plumb/rules`) need to be populated: 12 13 % mkdir -p ~/.plumb/openers 14 % cp openers/* ~/.plumb/openers 15 % cp rules ~/.plumb/rules 16 17 After that you can start using `plumb`, e.g.: 18 19 % plumb https://xkcd.com/1172/ 20 [... opens the URL to the web browser ...] 21 % plumb -n https://xkcd.com/1172/ 22 xkcd https://xkcd.com/1172/ 23 image https://imgs.xkcd.com/comics/workflow.png 24 % plumb -n https://imgs.xkcd.com/comics/workflow.png 25 image https://imgs.xkcd.com/comics/workflow.png 26 27 dplumb filter and show all URLs passed via arguments or stdin with 28 dmenu and then open the selected one via plumb, e.g.: 29 30 % cat << EOF | dplumb 31 ... doi:10.1145/361604.361612 32 ... https://tools.suckless.org/dmenu/ 33 ... gopher://gopherproject.org/ 34 ... EOF 35 [... opens dmenu with 3 lines, in the following order: ...] 36 [... ...] 37 [... 1. doi://10.1145/361604.361612 ...] 38 [... 2. https://tools.suckless.org/dmenu/ ...] 39 [... 3. gopher://gopherproject.org/ ...] 40 [... ...] 41 [... If an entry is seleted plumb will be invoked accordingly. ...] 42 43 It is also possible to just filter and show all URLs - without 44 invoking nor dmenu nor plumb - via `-l` option, e.g.: 45 46 % cat << EOF | dplumb -l 47 ... arXiv:1610.07997 48 ... https://en.wikipedia.org/ 49 ... http://ars.userfriendly.org/cartoons/?id=20170824 50 ... EOF 51 arxiv://1610.07997 52 https://en.wikipedia.org/ 53 http://ars.userfriendly.org/cartoons/?id=20170824 54 55 For more information regarding the real plumber please read Plumbing 56 and Other Utilities by Rob Pike: 57 58 <http://www.usenix.org/publications/library/proceedings/usenix2000/general/full_papers/pikeplumb/pikeplumb.pdf>