From 76c5f62548c60492a40aaff56655b83de5991944 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Mon, 3 Jul 2023 17:04:50 +0530 Subject: linkhandler: can now detect onion urls not just domains --- .local/bin/linkhandler | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler index cae7192..71bdbef 100755 --- a/.local/bin/linkhandler +++ b/.local/bin/linkhandler @@ -28,11 +28,12 @@ main() curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" && exec "$TERMINAL" -e xdg-open "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" > /dev/null 2>&1 & ;; - *.onion) - exec tor-browser "$1" >/dev/null 2>&1 - ;; *) - exec "$BROWSER" "$1" >/dev/null 2>&1 + if echo "$1" | grep -Eqx '^https?://[^/]*\.onion(/.*)?'; then + exec tor-browser "$1" >/dev/null 2>&1 + else + exec "$BROWSER" "$1" >/dev/null 2>&1 + fi ;; esac } -- cgit v1.2.3