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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
chndlr
======
chndlr is a simple, fast, and suckless replacement for xdg-open.
It determines the appropriate application to open a file or URL based on
user-defined rules in config.h.
Features
--------
* Minimal and fast
* No unnecessary dependencies
* Proven config.h configuration
* Works on UNIX-like systems
Installation
------------
$ make
$ sudo make install
Usage
-----
$ chndlr music.mp3
$ chndlr https://www.youtube.com/watch?v=dQw4w9WgXcQ
config.h
--------
chndlr uses config.h for configuration,
Entries to `pairs` can be added with easy to use macros P and WEB_PREFIX,
static const Pair pairs[] = {
P( "\\.mp3", "st", "-e", "mplayer", "%s");
P( WEB_PREFIX("github.com") "/([^/]+)/([^/]+)/actions",
"gh run list --repo %1/%2/%3" )
...
};
For the input,
$ chndlr 'https://www.github.com/bharatvaj/chndlr'
We get,
%1 - https://www.github.com
%2 - bharatvaj
%3 - chndlr
%s - https://www.github.com/bharatvaj/chndlr
%0-%9 and %s are available for substituion.
To know more the about capture group sytax, see regex(7).
chndlr uses 'execvp()' instead of 'system()' to speed up launching processes.
This means that the following would NOT work.
/* config.h */
P( "\\.gif$",
"wget", "-O", "/tmp/tmp.gif %s && gifview -a /tmp/tmp_gifview.gif")
Credits
-------
Forked from soap.
https://github.com/FRIGN/soap