mine-hyprdots/bin/search.sh

25 lines
504 B
Bash
Raw Permalink Normal View History

2025-03-18 17:13:53 +05:30
#!/bin/bash
ENGINE="$1"
shift
QUERY="$*"
ENCODED_QUERY=$(echo "$QUERY" | sed 's/ /+/g')
case "$ENGINE" in
2025-06-13 00:44:52 -04:00
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"
;;
searchxng)
xdg-open "https://findit.yerp.lat?q=$ENCODED_QUERY"
;;
*)
QUERY="$ENGINE $QUERY"
ENCODED_QUERY=$(echo "$QUERY" | sed 's/ /+/g')
xdg-open "https://www.google.com/search?q=$ENCODED_QUERY"
;;
2025-03-18 17:13:53 +05:30
esac