Compare commits

..

No commits in common. "master" and "1.6.2" have entirely different histories.

2 changed files with 6 additions and 11 deletions

View File

@ -19,8 +19,6 @@ act() {
return 0 return 0
} }
urldecode() { : "${*//+/ }"; printf '%b\n' "${_//%/\\x}"; }
# cfg foo bool = [true|1] # cfg foo bool = [true|1]
# cfg foo [string] = 'bar' # cfg foo [string] = 'bar'
# cfg foo # cfg foo
@ -122,8 +120,7 @@ handle_target() {
IFS=';' read target_mimetype _ <<< $( file -ib "$target" ) IFS=';' read target_mimetype _ <<< $( file -ib "$target" )
target_left=$target_mimetype target_left=$target_mimetype
[[ $target_mimetype == 'inode/symlink' ]] && \ IFS=';' read target_mimetype_true _ <<< $( file -ib "$target" )
IFS=';' read target_mimetype_true _ <<< $( file -ibL "$target" )
set -- "${mime_handlers[@]}" set -- "${mime_handlers[@]}"
elif is_uri "$target"; then elif is_uri "$target"; then
@ -223,7 +220,6 @@ main() {
done done
target=$1; [[ "$target" ]] || { usage; exit; } target=$1; [[ "$target" ]] || { usage; exit; }
# target=$(urldecode "$target") # No idea why I thought this was necessary.
cfg dryrun && { cfg dryrun && {
printf 'Dry run: not actually running the handler\n' >&2 printf 'Dry run: not actually running the handler\n' >&2

View File

@ -1,7 +1,6 @@
#!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.
# Regexes imply '^$'
# Disable desktop notifications # Disable desktop notifications
#cfg notify false #cfg notify false
@ -16,7 +15,7 @@
# %target% — The first argument to this script. # %target% — The first argument to this script.
# If not found, target is appended to the end of <cmd> # If not found, target is appended to the end of <cmd>
# example: # example:
#uri 'browser %target% --profile=work' 'https://.+\.?workdomain\.tld\..*' #uri 'browser %target% --profile=work' '^https://.+\.?workdomain.tld.*'
# scheme <cmd> <scheme>[ <scheme> ...] # scheme <cmd> <scheme>[ <scheme> ...]
#scheme browser http https #scheme browser http https
@ -24,10 +23,10 @@
# Or you can specify a regex for the entire uri: # Or you can specify a regex for the entire uri:
# uri <cmd> <regex>[ <regex> ...] # uri <cmd> <regex>[ <regex> ...]
#uri steam 'steam:.+' #uri steam '^steam:'
#uri browser '(https?|ftp):.+' #uri browser '^(https?|ftp):'
# Mime types for filesystem targets: # Mime types for filesystem targets:
# mime <cmd> <regex>[ <regex> ...] # mime <cmd> <regex>[ <regex> ...]
#mime sxiv 'image/.+' #mime sxiv '^image/'
#mime libreoffice 'application/msword' #mime libreoffice '^application/msword$'