THEAARBS menus - search

Raw

#!/bin/sh
# Easy web searching

SearchSites="DuckDuckGo\nArchWiki\nBandCamp\nGitHub\nIMDB\nReddit\nRev\nWikipedia\nYouTube"

Query=${@:2}

Choice=$1

case $(tty) in tty) mymenu="dwmenu Service" runprefix="$TERMINAL -e" ;; *) mymenu="fzf –prompt="Service"" runprefix= ;; esac

if [ -z "$Choice" ]; then Choice=$(echo -e $SearchSites | sort -n | $mymenu) || exit ; fi if [ -z "$Query" ]; then Query=$(inprompt "Terms") || exit ; fi if [ -z "$Query" ]; then exit ; fi if [ -z "$Choice" ]; then Choice="ddg" ; fi

case "$Choice" in r|Reddit) $runprefix rtv -s "$Query" ;; yt|YouTube) $runprefix youtube-viewer $Query ;; rev|Rev) $BROWSER "https://revolutiontt.me/browse.php?search=</span>$Query<span style="color:#e6db74">" ;; ddg|DuckDuckGo) $BROWSER "https://duckduckgo.com/?q=</span>$Query<span style="color:#e6db74">&t=ffab&atb=v1-1" ;; aw|ArchWiki) $BROWSER "https://wiki.archlinux.org/index.php?search=</span>$Query<span style="color:#e6db74">" ;; git|GitHub) $BROWSER "https://github.com/search?q=</span>$Query<span style="color:#e6db74">" ;; w|Wikipedia) $BROWSER "https://en.wikipedia.org/?search=</span>$Query<span style="color:#e6db74">" ;; bc|BandCamp) $BROWSER "https://bandcamp.com/search?q=</span>$Query<span style="color:#e6db74">" ;; im|IMDB) $BROWSER "http://www.imdb.com/find?ref_=nv_sr_fn&amp;q=</span>$Query<span style="color:#e6db74">&s=all" ;; esac


categories · links · piano · posts · scripts · THEAARBS · home