diff options
| author | Josh Hubbard <jhubbardsf@gmail.com> | 2023-12-06 09:15:53 +0100 |
|---|---|---|
| committer | Carlo Sala <carlosalag@protonmail.com> | 2023-12-06 09:16:43 +0100 |
| commit | 346bd1cd53e1bd3bd881f94552efadeebab430e4 (patch) | |
| tree | d7d1abcf00371bc9bcdc1e767d6b38d5c119ddc3 /plugins/frontend-search/frontend-search.plugin.zsh | |
| parent | c37df3ebd48df98b0987d891acc7ea30044bb113 (diff) | |
| download | zsh-346bd1cd53e1bd3bd881f94552efadeebab430e4.tar.gz zsh-346bd1cd53e1bd3bd881f94552efadeebab430e4.tar.bz2 zsh-346bd1cd53e1bd3bd881f94552efadeebab430e4.zip | |
feat(frontend-search): add `I am lucky` option
Diffstat (limited to 'plugins/frontend-search/frontend-search.plugin.zsh')
| -rw-r--r-- | plugins/frontend-search/frontend-search.plugin.zsh | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/frontend-search/frontend-search.plugin.zsh b/plugins/frontend-search/frontend-search.plugin.zsh index 541b23701..c96596eb9 100644 --- a/plugins/frontend-search/frontend-search.plugin.zsh +++ b/plugins/frontend-search/frontend-search.plugin.zsh @@ -30,10 +30,16 @@ alias vuejs='frontend vuejs' alias nextjs='frontend nextjs' function _frontend_fallback() { - case "$FRONTEND_SEARCH_FALLBACK" in - duckduckgo) echo "https://duckduckgo.com/?sites=$1&q=" ;; - *) echo "https://google.com/search?as_sitesearch=$1&as_q=" ;; - esac + if [[ "$FRONTEND_SEARCH_FALLBACK_LUCKY" == "true" ]]; then + case true in + *) echo "https://duckduckgo.com/?q=!ducky+site%3A$1+" ;; + esac + else + case "$FRONTEND_SEARCH_FALLBACK" in + duckduckgo) echo "https://duckduckgo.com/?sites=$1&q=" ;; + *) echo "https://google.com/search?as_sitesearch=$1&as_q=" ;; + esac + fi } function frontend() { |
