Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
02c7e5cb1a | |||
b32491ea9c |
@@ -1,7 +1,7 @@
|
||||
sx-open
|
||||
=======
|
||||
|
||||
sx-open is an attemt to implement a saner alternative to xdg-open.
|
||||
sx-open is an attempt to implement a saner alternative to xdg-open.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
4
sx-open
4
sx-open
@@ -11,7 +11,7 @@ handle_uri() {
|
||||
local target="$1"
|
||||
|
||||
for h in "${!uri_handlers[@]}"; do
|
||||
grep -oE "${uri_handlers[${h}]}" &>/dev/null <<< "$target" && {
|
||||
[[ "$target" =~ ${uri_handlers[${h}]} ]] && {
|
||||
${h} "$target" &
|
||||
return 0
|
||||
}
|
||||
@@ -26,7 +26,7 @@ handle_fs_target() {
|
||||
target_mimetype=$(file -ib "$target")
|
||||
|
||||
for m in "${!mime_handlers[@]}"; do
|
||||
grep -oE "${mime_handlers[${m}]}" &>/dev/null <<< "$target_mimetype" && {
|
||||
[[ "$target_mimetype" =~ ${mime_handlers[${m}]} ]] && {
|
||||
${m} "$target" &
|
||||
return 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user