-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch
More file actions
executable file
·57 lines (56 loc) · 2.78 KB
/
search
File metadata and controls
executable file
·57 lines (56 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
# __ __ _ _
# \ \ / / | | | |
# \ \ /\ / /__| |__ ___ ___ __ _ _ __ ___| |__
# \ \/ \/ / _ \ '_ \/ __|/ _ \/ _` | '__/ __| '_ \
# \ /\ / __/ |_) \__ \ __/ (_| | | | (__| | | |
# \/ \/ \___|_.__/|___/\___|\__,_|_| \___|_| |_|
# Author: Ayush Jaayswal
# website: ayusjayswal.github.io
# Github: github.com/ayusjayaswal/scripts/blob/main/search
#
declare -A websearch
# Search Engines
websearch[Bing]="https://www.bing.com/search?q="
websearch[Brave]="https://search.brave.com/search?q="
websearch[Duckduckgo]="https://duckduckgo.com/?q="
websearch[Gemini search \(https\)]="https://portal.mozz.us/gemini/geminispace.info/search%3F"
websearch[Google]="https://www.google.com/search?q="
websearch[Qwant]="https://www.qwant.com/?q="
websearch[Swisscows]="https://swisscows.com/web?query="
websearch[Yandex]="https://yandex.com/search/?text="
# Information/News
websearch[BBCnews]="https://www.bbc.co.uk/search?q="
websearch[CNN]="https://www.cnn.com/search?q="
websearch[the Times of India]="https://timesofindia.indiatimes.com/topic/"
websearch[Googlenews]="https://news.google.com/search?q="
websearch[Wikipedia]="https://en.wikipedia.org/w/index.php?search="
websearch[Wiktionary]="https://en.wiktionary.org/w/index.php?search="
# Social Media
websearch[Reddit]="https://www.reddit.com/search/?q="
websearch[Odysee]="https://odysee.com/$/search?q="
websearch[Youtube]="https://www.youtube.com/results?search_query="
# Online Shopping
websearch[Amazon]="https://www.amazon.in/s?k="
websearch[Flipkart]="https://www.flipkart.com/search?q="
websearch[Craigslist]="https://www.craigslist.org/search/sss?query="
websearch[Ebay]="https://www.ebay.com/sch/i.html?&_nkw="
websearch[Gumtree]="https://www.gumtree.com/search?search_category=all&q="
# Linux
websearch[Archaur]="https://aur.archlinux.org/packages/?O=0&K="
websearch[Archpkg]="https://archlinux.org/packages/?sort=&q="
websearch[Archwiki]="https://wiki.archlinux.org/index.php?search="
websearch[Debianpkg]="https://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords="
# Development
websearch[Github]="https://github.com/search?q="
websearch[Gitlab]="https://gitlab.com/search?search="
websearch[GoogleOpenSource]="https://opensource.google/projects/search?q="
websearch[Sourceforge]="https://sourceforge.net/directory/?q="
websearch[Stackoverflow]="https://stackoverflow.com/search?q="
# Etc
engine=$(printf '%s\n' "${!websearch[@]}" | sort | dmenu -i -p 'ﰍ Choose search engine: ' "$@" -l 10) || exit 1
url="${websearch["${engine}"]}"
query=$(echo "$engine" | dmenu -p 'Enter search query:')
query="$(echo -n "${query}" )"
browser=$(printf "brave \nfirefox \nvieb \nqutebrowser"|dmenu -l 5 -p "Choose Browser")
$browser "${url}${query}"