summaryrefslogtreecommitdiff
path: root/.i3/scripts/ducksearch
blob: 13a1e19562e6ef175566e602b80ab6b3df3cb068 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

# Gives a dmenu prompt to search DuckDuckGo.
# Without input, will open DuckDuckGo.com.
# Anything else, it search it.

pgrep -x dmenu && exit

choice=$(echo "🦆" | dmenu -i -p "Search DuckDuckGo:") || exit 1

if [ "$choice" = "🦆"  ]; then
	$BROWSER "https://duckduckgo.com"
else
	$BROWSER "https://duckduckgo.com/?q=$choice&t=ffab&atb=v1-1"
fi