From 381aaffe4ed3caa0f1356b720f6d4fc0de5b1f8f Mon Sep 17 00:00:00 2001 From: davidovski Date: Mon, 16 May 2022 00:48:34 +0100 Subject: removed bash and added mkshrc --- scripts/websearch | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'scripts/websearch') diff --git a/scripts/websearch b/scripts/websearch index 996ddc3..32d8773 100755 --- a/scripts/websearch +++ b/scripts/websearch @@ -1,14 +1,17 @@ #!/bin/sh - -SEARCH_ENGINE="https://search.brave.com/search?q=" -SEARCH_HISTORY=/tmp/.search_history +browser="links-launcher" +SEARCH_ENGINE="https://librex.beparanoid.de/search.php?q=" +SEARCH_HISTORY=$HOME/.local/share/search_history SEARCH=$(cat $SEARCH_HISTORY | dmenu -p "search") -touch $SEARCH_HISTORY +echo "$SEARCH" >> $SEARCH_HISTORY -cat <<< "$SEARCH -$(cat $SEARCH_HISTORY)" > $SEARCH_HISTORY +query=$(echo $SEARCH | sed 's/ /+/g') -brave "$SEARCH_ENGINE$SEARCH" +echo $query | grep -q '(?=^.{5,254}$)(^(?:(?!\d+\.)[a-zA-Z0-9_\-]{1,63}\.?)+(?:[a-zA-Z]{2,})$)' && { + links-launcher "$query" +} || { + links-launcher "$SEARCH_ENGINE$query" +} -- cgit v1.2.1