-
Notifications
You must be signed in to change notification settings - Fork 2
/
rules
37 lines (30 loc) · 836 Bytes
/
rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# If SHELL and SHELL_OPTS aren't defined thr plumber will use the
# default shell /bin/sh with the -c option.
SHELL=/bin/sh
SHELL_OPTS='-c'
LastWin='acme/$(9p ls acme |sort -rn |sed 1q)'
# urls
type is text
data matches '(http|https|ftp|file|gopher|telnet)://[a-zA-Z0-9@\/\.\-_]+'
plumb start surf $data
# man pages
type is text
data matches '([a-zA-Z0-9\-_\/]+)\(([0-9])\)'
plumb start man $2 $1 |9p write acme/new/body
plumb start echo clean |9p write ${LastWin}/ctl
# images
type is text
data matches '([a-zA-Z0-9\/\-_\.@]+).(png|PNG|jpe?g|JPE?G)'
arg isfile $0
plumb start feh $file
# .pdf .ps
type is text
data matches '([a-zA-Z0-9\/\-_\.@]+).(pdf|ps)'
arg isfile $0
plumb start zathura $file
# plumb file to sam
type is text
data matches '.+'
arg isfile $0
plumb start sam $file
# A blank line expected after the last rule