summaryrefslogtreecommitdiff
path: root/dwm-6.3/scripts/dwm-search
blob: ff49fc75115caec7239e8f609601a3af21c847e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

QUERY=$(tac ~/.config/surf/search.txt | sort -u | dmenu -l 20 -p "Search DuckDuckGo: ")
SEARCH=$(echo $QUERY | sed 's/ /+/g; s/-e//')
URL="duckduckgo.com/?q=$SEARCH"
CMD="firejail --noprofile --hosts-file=~/.config/surf/ads.txt tabbed -dn tabbed-surf -r 2 surf -e '' $URL"

if [[ -z "$SEARCH" ]]; then
	exit
else
	# saves search to history
	echo $QUERY | sed 's/-e//' >> ~/.config/surf/search.txt
	$CMD
fi