even smarter DSL
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
parent
c054744d48
commit
739c430e42
8
sx-open
8
sx-open
|
@ -93,6 +93,14 @@ mime() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scheme() {
|
||||||
|
declare r handler=$1; shift
|
||||||
|
|
||||||
|
for s in "$@"; do
|
||||||
|
uri_handlers+=( "$handler" "^$s:" )
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
is_uri() [[ $1 =~ ^[a-zA-Z][a-zA-Z0-9\+\.\-]+:.+ ]]
|
is_uri() [[ $1 =~ ^[a-zA-Z][a-zA-Z0-9\+\.\-]+:.+ ]]
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
|
11
sx-open.cfg
11
sx-open.cfg
|
@ -1,12 +1,17 @@
|
||||||
#!syntax bash
|
#!syntax bash
|
||||||
# Configuration file for sx-open
|
# Configuration file for sx-open
|
||||||
# Note that as sx-open checks the regexes in order, they should be placed in order from specific to less so.
|
# Note that as sx-open checks the regexes in order, they should be placed in order from specific to less so.
|
||||||
# Format: type cmd regex
|
|
||||||
|
|
||||||
# Examples:
|
# scheme <cmd> <scheme>[ <scheme> ...]
|
||||||
|
#scheme browser http https
|
||||||
|
#scheme steam steam
|
||||||
|
|
||||||
#uri browser '^https?:'
|
# Or you can specify a regex for the entire uri:
|
||||||
|
# uri <cmd> <regex>[ <regex> ...]
|
||||||
#uri steam '^steam:'
|
#uri steam '^steam:'
|
||||||
|
#uri browser '^(https?|ftp):'
|
||||||
|
|
||||||
|
# Mime types for filesystem targets:
|
||||||
|
# mime <cmd> <regex>[ <regex> ...]
|
||||||
#mime sxiv '^image/'
|
#mime sxiv '^image/'
|
||||||
#mime libreoffice '^application/msword$'
|
#mime libreoffice '^application/msword$'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user