Created
March 22, 2018 23:15
-
-
Save grafov/8992bd5f497e7e450a8b74a39ece79de to your computer and use it in GitHub Desktop.
Web search in Surf with history (with using Rofi)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/dash | |
AGENT="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3" | |
#OPTS='-z 1.5 -u "$AGENT"' | |
OPTS="-z 1.8" | |
HISTORY=.rofi-wwwsearch-history | |
if [ "$1" = "" ] | |
then | |
URL=`cat $HISTORY | rofi -hide-scrollbar -dmenu -p "Websearch: "` | |
echo "$URL" | grep -e ^http || CLIP=https://$CLIP | |
echo "$URL" >> $HISTORY | |
else | |
URL=$@ | |
echo "$@" | grep -e ^http && CLIP=https://$CLIP | |
echo "$@" >> $HISTORY | |
fi | |
TMP=`tempfile` | |
cat $HISTORY | sort | uniq >> $TMP && mv $TMP $HISTORY | |
rm -f $TMP | |
if [ "$URL" = "" ] | |
then | |
exit 0 | |
fi | |
/usr/bin/surf $OPTS "https://duckduckgo.com/?q=$URL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment