search for clipboard contents feature added

This commit is contained in:
Alexander Bocken 2020-09-04 17:12:32 +02:00
parent 05146301fc
commit 3de15502ea

View File

@ -5,10 +5,12 @@
# Anything else, it search it. # Anything else, it search it.
browser=${BROWSER:-firefox} browser=${BROWSER:-firefox}
choice=$(echo "🔍" | dmenu -i -p "Searx:") || exit 1 choice=$(printf "🔍\n📋\n" | dmenu -i -p "Searx:") || exit 1
if [ "$choice" = "🔍" ]; then if [ "$choice" = "🔍" ]; then
$browser "https://searx.bocken.org" $browser "https://searx.bocken.org"
elif [ "$choice" = "📋" ]; then
$browser "$(xclip -o --clipboard=clipboard)"
else else
if echo "$choice" | grep "^(http:\/\/|https:\/\/)?[a-zA-Z0-9]+\.[a-zA-Z]+(/)?.*$"; then if echo "$choice" | grep "^(http:\/\/|https:\/\/)?[a-zA-Z0-9]+\.[a-zA-Z]+(/)?.*$"; then
$browser "$choice" $browser "$choice"