diff --git a/.local/bin/tools/searx b/.local/bin/tools/searx index 3e0f552..141e889 100755 --- a/.local/bin/tools/searx +++ b/.local/bin/tools/searx @@ -5,12 +5,16 @@ # Anything else, it search it. browser=${BROWSER:-firefox} -choice=$(printf "šŸ”\nšŸ“‹\n" | dmenu -i -p "Searx:") || exit 1 +if [ -z "$(xclip -o -selection clipboard)" ]; then + choice=$(printf "šŸ”\n" | dmenu -i -p "Searx:") || exit 1 +else + choice=$(printf "šŸ”\nšŸ“‹\n" | dmenu -i -p "Searx:") || exit 1 +fi if [ "$choice" = "šŸ”" ]; then $browser "https://searx.bocken.org" elif [ "$choice" = "šŸ“‹" ]; then - $browser "$(xclip -o --clipboard=clipboard)" + $browser "$(xclip -o -selection clipboard)" else if echo "$choice" | grep "^(http:\/\/|https:\/\/)?[a-zA-Z0-9]+\.[a-zA-Z]+(/)?.*$"; then $browser "$choice"