fogine / rofi-search

Interactive Google / DuckDuckGo search via rofi
MIT License
100 stars 7 forks source link
dmenu duckduckgo google-search linux rofi search-as-you-type

rofi-search

Interactive web search via rofi.
Multiple search engines supported.

Preview (click for large preview)

Installation

AUR package rofi-search-git

or npm install -g rofi-search

or copy rofi-search to your $PATH

Features

Dependencies

HOW TO RUN

Simply execute rofi-search in terminal (needs ddgr dependency to be installed).
Or see Usage section bellow for more advanced use cases.

Usage

You can choose between multiple methods of getting search results. Each one will give slightly different results.
You can even let rofi-search combine search results from multiple search engines.

Examples

NOTE: In the following examples, to be able to pass rofi-search to rofi and execute it with custom configuration, env configuration variable ROFI_SEARCH is required to be set.

Google CSE
export GOOGLE_API_KEY='google-api-key'
export GOOGLE_SEARCH_ID='google-search-engine-id'
export ROFI_SEARCH='cse'

rofi -modi blocks -blocks-wrap /absolute/path/to/rofi-search -show blocks \ 
-lines 4 -eh 4 -kb-custom-1 'Control+y' -theme /path/to/your/theme.rasi
ddgr
#for additional ddgr options see "ddgr --help"
export DDG_ARGS='["-n", 5]'
export ROFI_SEARCH='ddgr'

rofi -modi blocks -blocks-wrap /absolute/path/to/rofi-search -show blocks \ 
-lines 4 -eh 4 -kb-custom-1 'Control+y' -theme /path/to/your/theme.rasi 
combine top free results from DuckDuckGo and Google
export DDG_ARGS='["-n", 3]'
export ROFI_SEARCH='cse,ddgr'

rofi -modi blocks -blocks-wrap /absolute/path/to/rofi-search -show blocks \ 
-lines 4 -eh 4 -kb-custom-1 'Control+y' -theme /path/to/your/theme.rasi

You can fetch rofi theme used in the gif preview HERE

Options

supported rofi actions

TODO (PR is welcome)