# to update: {^echo w^$nl^w /mnt/plumb/rules} include fileaddr path = [a-zA-Z¡-￿0-9_\-+.,!/]+ pathelem = [a-zA-Z¡-￿0-9_\-+.,!]+ url = [a-zA-Z0-9\-._~:/?#[\]@!$&''()*+,;=%]+ urlelem = [a-zA-Z0-9\-._~]+ # get off my lawn type is text data matches /dev/.* plumb start echo some fucker plumbed $data # audio type is text data matches $url|$path data matches ($url|$path)\.(mp3|ogg|flac|m3u|pls|wav|mod|MOD) plumb start window -hide -scroll -cd $wdir play $data type matches audio/.+ plumb start window -hide -scroll -cd $wdir play $data # video type is text data matches $path data matches $path\.mp4 arg isfile $data plumb start window -r 1 294 649 662 treason $file type is text data matches vid://(twitter.com/($url)) plumb start window -r 1 294 321 614 twitvid '''http://'$1'''' type matches video/.+ plumb start window -r 1 294 649 662 -cd $wdir treason $data # webshit type is text data matches ($path)<(https?://$url) plumb start rc -c 'hget '''$2''' | tput -p > '$1' |[2] aux/statusmsg -k '$1 type is text data matches https?://(www\.)?youtu(\.be/|be\.com/watch\?v=)$urlelem plumb start window -scroll -r 0 416 9000 756 yt ''''$data'''' type is text data matches https?://$urlelem\.bandcamp.com/(track|album)/$urlelem plumb start window -scroll -r 0 416 9000 756 bandcamp $data type is text data matches https?://soundcloud.com/$urlelem/$urlelem plumb start sc $data type is text data matches gits?://$url plumb start window -cd /tmp/c rs; echo git/clone $data ; git/clone $data && c `{basename $data} ; rc type is text data matches https?://twitter.com/($url) data set http://nitter.net/$1 plumb to web plumb client w webshit type is text data matches https?://imgur.com/a/[a-zA-Z0-9]+ plumb start rc -c 'hget '$data' | grep post-image-container | sed -e ''s/.*div id="//; s/" class.*//'' | sed -e ''s/^/https:\/\/i.imgur.com\//; s/$/.jpg/'' | xargs -n 1 plumb' type is text data matches (https?|gemini)://$url|/tmp/webshit/.*|(\[|{)[0-9]+(\]|})|←|•|→|\[formfield\]|hpost.* plumb to web plumb client w webshit # mail plumb to seemail plumb to showmail type is text data matches $path data matches /mail/fs/$pathelem/[0-9]+ plumb start window -r 44 0 1000 2000 upas/nedmail -s $0 type is text data matches $urlelem@$urlelem plumb start w mail $0 # images & docs type is text data matches $path data matches ($path\.(ps|PS|eps|EPS|pdf|PDF|dvi|DVI|doc|DOC|epub|EPUB|cb[tz]|CB[TZ]|jpe?g|JPE?G|gif|GIF|tiff?|TIFF?|ppm|PPM|bit|BIT|png|PNG|pgm|PGM|bmp|BMP|yuv|YUV))(!($path))? arg isfile $1 data set $file attr add addr=$4 plumb to image plumb client window -r 0 0 9000 9000 'LABEL page; page -i' type matches image/.+|application/(troff|postscript|pdf|ghostscript) plumb to image plumb client window -r 0 0 9000 9000 'LABEL page; page -i' # man pages (section 0 matches all sections) type is text data matches ($pathelem)\(([0-9])\) plumb start rc -c 'man -w '$2' '$1' | sed ''s,/sys(/man/.+),/tmp\1.ps,'' | xargs -n 1 plumb' # editor type is text data matches ($path)($addr)? arg isfile $1 data set $file attr add addr=$3 plumb to edit plumb client window sam -a # .h files are looked up in /sys/include and passed to edit type is text data matches ($path\.h)($addr)? arg isfile /sys/include/$1 data set $file attr add addr=$3 plumb to edit plumb client window sam -a # directory browsing type is text data matches $path arg isdir $data plumb start w c $dir # RFC references are looked up in /lib/rfc and passed to editor type is text data matches 'RFC ?([0-9]+)' arg isfile /lib/rfc/rfc$1 data set $file plumb to edit plumb client window sam -a # operate in plumber's namespace type is text data matches 'Local (.*)' plumb to none plumb start rc -c $1 # look anything else up in the dictionary type is text data matches [a-zA-Z]+ plumb start w d etym `{echo $data | tr A-Z a-z} '|' fmt