Handling files by name. Takes precedence over mimes.

This commit is contained in:
2014-11-21 13:48:09 +03:00
parent 93ec32f793
commit 545447c9b0
2 changed files with 14 additions and 0 deletions

View File

@@ -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