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