only show clipboard option if clipboard is non-empty
modified: .local/bin/tools/searx
This commit is contained in:
parent
3de15502ea
commit
ccc2d1ef6d
@ -5,12 +5,16 @@
|
||||
# Anything else, it search it.
|
||||
browser=${BROWSER:-firefox}
|
||||
|
||||
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"
|
||||
|
Loading…
Reference in New Issue
Block a user