diff --git a/sx-open b/sx-open index 92765f7..639d26e 100755 --- a/sx-open +++ b/sx-open @@ -21,7 +21,7 @@ handle_uri() { } handle_fs_target() { - local target="$1" + local target="${1##*file://}" [[ -e "$target" ]] || return 1 @@ -41,7 +41,7 @@ main() { target="$1" [[ "$target" ]] || { usage; exit; } - if [[ -e "$target" ]]; then + if [[ -e "$target" || "$target" == 'file://'* ]]; then handle_fs_target "$target" else handle_uri "$target"