Interactive web search via rofi.
Multiple search engines supported.
AUR package rofi-search-git
or npm install -g rofi-search
or copy rofi-search to your $PATH
I'm Feeling Lucky
- Open the first result directly without waiting for the results to rendernodejs >= 8.2.1
rofi-blocks-git
package in AUR)xclip
copy to clipboardSimply execute rofi-search
in terminal (needs ddgr
dependency to be installed).
Or see Usage section bellow for more advanced use cases.
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.
ddgr
does not parse information about number of search results
so this information is not currently available when using this methodUse google's custom search engine API by setting GOOGLE_API_KEY
& GOOGLE_SEARCH_ID
env variables
It can Search the entire web if you enable it in settings
You will need to go to https://cse.google.com/cse/all and create your own google custom search engine.
Search engine ID
from the settings panelGet API KEY for the created search engine.
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.
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
#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
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
GOOGLE_API_KEY
- secret key to access Google API. You can get it hereGOOGLE_SEARCH_ID
- Your custom search engine (cse) IDDDG_ARGS
- ddgr
command line arguments. Serialized json array.ROFI_SEARCH
- comma separated search methods
cse
, ddgr
rofi-search
will make multiple parallel searches
and combine search results in the order search methods were definedTITLE_COLOR
- customize search result title color (default blue).
This can't be set in rofi themeROFI_SEARCH_TIMEOUT
- integer - delay between last character typed and automatic search execution (default 500
ms)ROFI_SEARCH_DEBUG
- enables verbose logging if set to any valueROFI_SEARCH_CMD
- a command to execute when pressing -kb-accept-entry
(enter
) - defaults to xdg-open
export ROFI_SEARCH_CMD='google-chrome $URL'
-kb-accept-entry
- open url with xdg-open
(aka. your default browser)-kb-accept-custom
- open search results on google.com
in your browser-kb-custom-1
- copy url to clipboard