diff options
author | davidovki <david@davidovski.xyz> | 2023-03-10 17:06:03 +0000 |
---|---|---|
committer | davidovki <david@davidovski.xyz> | 2023-03-10 17:06:03 +0000 |
commit | b71fd9bbb97c32cd90a2d8f1c817cd601a79fff6 (patch) | |
tree | eb8f4f7ffde01b464ba412ed25fdfef9b92ebe0e /scripts/websearch | |
parent | 3538699954861f86ab89019c30a3ff1d332b7511 (diff) |
Fix websearch to use browser env var
Diffstat (limited to 'scripts/websearch')
-rwxr-xr-x | scripts/websearch | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/websearch b/scripts/websearch index 32d8773..5ffb91b 100755 --- a/scripts/websearch +++ b/scripts/websearch @@ -1,7 +1,8 @@ #!/bin/sh -browser="links-launcher" -SEARCH_ENGINE="https://librex.beparanoid.de/search.php?q=" +default_browser="links-launcher" +BROWSER=${BROWSER:-$default_browser} +SEARCH_ENGINE="https://search.davidovski.xyz/search.php?q=" SEARCH_HISTORY=$HOME/.local/share/search_history SEARCH=$(cat $SEARCH_HISTORY | dmenu -p "search") @@ -11,7 +12,7 @@ echo "$SEARCH" >> $SEARCH_HISTORY query=$(echo $SEARCH | sed 's/ /+/g') echo $query | grep -q '(?=^.{5,254}$)(^(?:(?!\d+\.)[a-zA-Z0-9_\-]{1,63}\.?)+(?:[a-zA-Z]{2,})$)' && { - links-launcher "$query" + $BROWSER "$query" } || { - links-launcher "$SEARCH_ENGINE$query" + $BROWSER "$SEARCH_ENGINE$query" } |