Handling files by name. Takes precedence over mimes.
This commit is contained in:
parent
93ec32f793
commit
545447c9b0
9
sx-open
9
sx-open
|
@ -23,6 +23,15 @@ handle_uri() {
|
|||
handle_fs_target() {
|
||||
local target="${1##*file://}"
|
||||
|
||||
target_filename="${target##*/}"
|
||||
|
||||
for n in "${!filename_handlers[@]}"; do
|
||||
[[ "$target_filename" =~ ${filename_handlers[${n}]} ]] && {
|
||||
${n} "$target" &
|
||||
return 0
|
||||
}
|
||||
done
|
||||
|
||||
target_mimetype=$(file -ib "$target")
|
||||
|
||||
for m in "${!mime_handlers[@]}"; do
|
||||
|
|
|
@ -3,12 +3,17 @@
|
|||
|
||||
declare -A uri_handlers
|
||||
declare -A mime_handlers
|
||||
declare -A filename_handlers
|
||||
|
||||
uri_handlers=(
|
||||
["steam"]='^steam://.+'
|
||||
["browser"]='.+'
|
||||
)
|
||||
|
||||
filename_handlers=(
|
||||
["javaws"]='^kvm.+?\.cgi$'
|
||||
)
|
||||
|
||||
mime_handlers=(
|
||||
["sxiv"]='image/.+'
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user