Massive Updates
This commit is contained in:
1 parent
007c2f8edb
commit
5f37d6c0ec
109 files changed
+7670
-3972
No files matched your search
Executable
+64
@@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Requirements:
|
||||
# rofi
|
||||
# Description:
|
||||
# Use rofi to search the web.
|
||||
# Usage:
|
||||
# web-search.sh
|
||||
# -----------------------------------------------------------------------------
|
||||
# Script:
|
||||
|
||||
declare -A URLS
|
||||
|
||||
URLS=(
|
||||
["google"]="https://www.google.com/search?q="
|
||||
["bing"]="https://www.bing.com/search?q="
|
||||
["yahoo"]="https://search.yahoo.com/search?p="
|
||||
["duckduckgo"]="https://www.duckduckgo.com/?q="
|
||||
["yandex"]="https://yandex.ru/yandsearch?text="
|
||||
["github"]="https://github.com/search?q="
|
||||
["goodreads"]="https://www.goodreads.com/search?q="
|
||||
["stackoverflow"]="http://stackoverflow.com/search?q="
|
||||
["symbolhound"]="http://symbolhound.com/?q="
|
||||
["searchcode"]="https://searchcode.com/?q="
|
||||
["openhub"]="https://www.openhub.net/p?ref=homepage&query="
|
||||
["superuser"]="http://superuser.com/search?q="
|
||||
["askubuntu"]="http://askubuntu.com/search?q="
|
||||
["imdb"]="http://www.imdb.com/find?ref_=nv_sr_fn&q="
|
||||
["rottentomatoes"]="https://www.rottentomatoes.com/search/?search="
|
||||
["piratebay"]="https://thepiratebay.org/search/"
|
||||
["youtube"]="https://www.youtube.com/results?search_query="
|
||||
["vimawesome"]="http://vimawesome.com/?q="
|
||||
)
|
||||
|
||||
# List for rofi
|
||||
gen_list() {
|
||||
for i in "${!URLS[@]}"
|
||||
do
|
||||
echo "$i"
|
||||
done
|
||||
}
|
||||
|
||||
main() {
|
||||
# Pass the list to rofi
|
||||
platform=$( (gen_list) | rofi -dmenu -matching fuzzy -no-custom -location 0 -p "Search > " )
|
||||
|
||||
if [[ -n "$platform" ]]; then
|
||||
query=$( (echo ) | rofi -dmenu -matching fuzzy -location 0 -p "Query > " )
|
||||
|
||||
if [[ -n "$query" ]]; then
|
||||
url=${URLS[$platform]}$query
|
||||
xdg-open "$url"
|
||||
else
|
||||
exit
|
||||
fi
|
||||
|
||||
else
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
exit 0
|
||||
Reference in new issue
Block a user