Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Interactive Google / DuckDuckGo search via rofi

License

NotificationsYou must be signed in to change notification settings

fogine/rofi-search

Repository files navigation

Interactive web search viarofi.
Multiple search engines supported.

Preview(click for large preview)

Installation

AUR packagerofi-search-git

ornpm install -g rofi-search

or copyrofi-search to your$PATH

Features

  • search as you type
  • Google search
  • DuckDuckGo search
  • I'm Feeling Lucky - Open the first result directly without waiting for the results to render
  • get top search results from multiple search engines
  • copy search result website url
  • open search result in web browser

Dependencies

  • nodejs >= 8.2.1
  • rofi-blocks (rofi-blocks-git package in AUR)
  • rofi
  • xclip copy to clipboard
  • ddgr(optional) DuckDuckGo search results scraper

HOW TO RUN

Simply executerofi-search in terminal (needsddgr dependency to be installed).
Or seeUsage 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 letrofi-search combine search results from multiple search engines.

  • Useddgr for scraping DuckDuckGo for search results

    • ddgr does not parse information about number of search resultsso this information is not currently available when using this method
  • Use google's custom search engine API by settingGOOGLE_API_KEY &GOOGLE_SEARCH_ID env variables

    • It can Search the entire web if you enable it in settings

    • You will need to go tohttps://cse.google.com/cse/all and create your own google custom search engine.

      • GetSearch engine ID from the settings panel
        Preview
    • Get API KEY for the created search engine.Preview

Examples

NOTE: In the following examples, to be able to passrofi-search torofi and execute it with custom configuration, env configuration variableROFI_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 previewHERE

Options

  • GOOGLE_API_KEY - secret key to access Google API. You can get ithere
  • GOOGLE_SEARCH_ID - Your custom search engine (cse) ID
  • DDG_ARGS -ddgr command line arguments. Serialized json array.
  • ROFI_SEARCH - comma separated search methods
    • Supported methods:cse,ddgr
    • If multiple methods are set,rofi-search will make multiple parallel searchesand combine search results in the order search methods were defined
  • TITLE_COLOR - customize search result title color (default blue).This can't be set in rofi theme
  • ROFI_SEARCH_TIMEOUT - integer - delay between last character typed and automatic search execution (default500ms)
  • ROFI_SEARCH_DEBUG - enables verbose logging if set to any value
  • ROFI_SEARCH_CMD - a command to execute when pressing-kb-accept-entry (enter) - defaults toxdg-open
    • example:export ROFI_SEARCH_CMD='google-chrome $URL'
supported rofi actions
  • -kb-accept-entry - open url withxdg-open (aka. your default browser)
  • -kb-accept-custom - open search results ongoogle.com in your browser
  • -kb-custom-1 - copy url to clipboard

TODO (PR is welcome)

  • DuckDuckGO integration
  • make font sizes configurable
  • buku integration

[8]ページ先頭

©2009-2025 Movatter.jp