Skip to content

Commit

Permalink
Allow custom searchproviders to be set as default
Browse files Browse the repository at this point in the history
  • Loading branch information
tschan committed Aug 18, 2017
1 parent 19f5c23 commit 2ce7532
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions rofi-surfraw/rofi-surfraw
Expand Up @@ -58,9 +58,20 @@ elif [[ $elvi == "?"* ]]; then
search=$(echo "${elvi}" | awk '{$1=""; print $0}' | cut -c 2-)
sr ${name} ${search}
else
name="${default}"
if [[ $default == "!"* ]]; then
entry=$(grep "$(echo "${default}" | awk '{ print $1 }')" "$HOME/.config/rofi-surfraw/searchengines")
method=$(echo "${entry}" | awk -F ' - ' '{ print $2 }')
bang=$(echo "${entry}" | awk -F ' - ' '{ print $3 }')
else
method="surfraw"
bang="$default"
fi
search="${elvi}"
sr ${name} ${search}
if [[ $method == "surfraw" ]]; then
sr ${bang} ${search}
elif [[ $method == "custom" ]]; then
"$SURFRAW_graphical_browser" $SURFRAW_graphical_browser_args ${bang}"${search}"
fi
fi
}

Expand Down

0 comments on commit 2ce7532

Please sign in to comment.