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
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ open() {
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}')"
[ -n "$url" ] && open "$url"