diff options
Diffstat (limited to 'env/.local/bin/scripts')
| -rwxr-xr-x | env/.local/bin/scripts/urlview.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/env/.local/bin/scripts/urlview.sh b/env/.local/bin/scripts/urlview.sh index 797f40f..394ac66 100755 --- a/env/.local/bin/scripts/urlview.sh +++ b/env/.local/bin/scripts/urlview.sh @@ -1,14 +1,14 @@ #!/bin/sh -url="$(grep -o -e 'http://[^"]*' -e 'https://[^"]*' <&0 | tr ' ' '\n' | fzf)" -[ "$url" = "" ] && exit +url="$(grep -Eo "https?://[^]})\"'' ]*" <&0 | fzf)" # extra ' because my editor dont syntax highlight correctly +[ ! "$url" ] && exit choices="\ clipboard browser/xdg-open" choice=$(echo "$choices" | fzf) -[ "$choice" = "" ] && exit +[ ! "$choice" ] && exit choice=$(echo "$choice" | sed -e 's/browser\/xdg-open/xdg-open/') # browser/xdg-open should just run xdg-open if [ "$choice" = "clipboard" ]; then |
