Add scripts
This commit is contained in:
parent
75db2e7ed4
commit
aa7266e92c
3 changed files with 101 additions and 0 deletions
24
bin/search.sh
Executable file
24
bin/search.sh
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
ENGINE="$1"
|
||||
shift
|
||||
QUERY="$*"
|
||||
|
||||
ENCODED_QUERY=$(echo "$QUERY" | sed 's/ /+/g')
|
||||
|
||||
case "$ENGINE" in
|
||||
yt)
|
||||
xdg-open "https://www.youtube.com/results?search_query=$ENCODED_QUERY"
|
||||
;;
|
||||
wikipedia)
|
||||
xdg-open "https://en.wikipedia.org/wiki/Special:Search?search=$ENCODED_QUERY"
|
||||
;;
|
||||
duckduckgo)
|
||||
xdg-open "https://duckduckgo.com/?q=$ENCODED_QUERY"
|
||||
;;
|
||||
*)
|
||||
QUERY="$ENGINE $QUERY"
|
||||
ENCODED_QUERY=$(echo "$QUERY" | sed 's/ /+/g')
|
||||
xdg-open "https://www.google.com/search?q=$ENCODED_QUERY"
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue