Now st-plumber also opens directories

This commit is contained in:
Ashish Kumar Yadav 2022-07-14 04:05:32 +05:30
parent d5e92fa6fc
commit eb96c5071f

View file

@ -5,7 +5,7 @@ open() {
exec setsid -f xdg-open "$1" exec setsid -f xdg-open "$1"
} }
[ -f "$1" ] && open "$1" { [ -f "$1" ] || [ -d "$1" ] ;} && open "$1"
url="$(echo "$1" | perl -M'Regexp::Common=URI' -ne 'if (/($RE{URI})/) {print $1; exit}')" url="$(echo "$1" | perl -M'Regexp::Common=URI' -ne 'if (/($RE{URI})/) {print $1; exit}')"
[ -n "$url" ] && open "$url" [ -n "$url" ] && open "$url"