diff options
Diffstat (limited to 'tmuxsh/_surfraw,--.search.the.internet')
-rwxr-xr-x | tmuxsh/_surfraw,--.search.the.internet | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tmuxsh/_surfraw,--.search.the.internet b/tmuxsh/_surfraw,--.search.the.internet new file mode 100755 index 0000000..d2de789 --- /dev/null +++ b/tmuxsh/_surfraw,--.search.the.internet @@ -0,0 +1,16 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: search internet from a list of search engines +# REQD: set a default terminal web browser +# $EDITOR ~/.bashrc +# export BROWSERCLI=w3m + +PREFIX=$(surfraw -elvi | grep -v 'LOCAL\|GLOBAL' | fzf -e -i -m --prompt='Select search engine(s): ' --info=default --layout=reverse --tiebreak=index | awk '{print $1}') +[ -z "$PREFIX" ] && exit +ENGINES=$(echo "$PREFIX" | tr '\n' ' ') +INPUT=$(echo | fzf --print-query --prompt="Enter keyword(s) to search ${ENGINES}: " --info=default --layout=reverse) +[ -z "$INPUT" ] && exit +echo "$PREFIX" | while read -r line; do + tmux new-window -n "sr-${line}" "$BROWSERCLI '"$(surfraw -p $line $INPUT)"'" +done |