Skip to content
FlareXesPublic

About

Trigger duckduckgo search (with bangs) from Rofi with a single keystroke.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Rofi + DuckDuckGo

A minimal Rofi-based web search launcher that uses DuckDuckGo bangs with optional local overrides. It provides a single prompt for fast searches without menus, history, or persistent state.

rofi-ddg.mp4

Features

  • DuckDuckGo bang support by default
  • Local prefix overrides for custom search engines
  • Single-input workflow

Requirements

  • rofi
  • jq (optional, for URL encoding)

Installation

git clone https://github.com/FlareXes/rofi-ddg.git
cd rofi-ddg
chmod +x rofi-ddg.sh

(Optional) Install system-wide:

sudo cp rofi-ddg.sh /usr/local/bin/rofi-ddg

Usage

rofi-ddg

Enter a search prefix followed by a query.

Examples:

  • g linux kernel → Google search
  • !y neovim tutorial → YouTube search

! doesn't matter.

Keybindings

For best experience, bind the script to a key combination according to your desktop environment or window manager. E.g.:

Hyprland

Add the following to your hyprland.conf:

bind = SUPER, SPACE, exec, rofi-ddg

Configuration

Browser

By default, the script uses xdg-open.

You may edit the script to change browser:

BROWSER="firefox"

Add custom or override bangs

Edit the BANGS associative array in the script:

declare -A BANGS=(
  ["g"]="https://www.google.com/search?q=%s"
  ["y"]="https://www.youtube.com/results?search_query=%s"
  ["gpt"]="https://chat.openai.com/?q=%s"
)
  • Keys are prefixes typed in the prompt
  • Values are URL templates
  • %s is replaced with the URL-encoded query

Local overrides take precedence over DuckDuckGo bangs.

License

MIT License.

Credits

I would like to thank:

  • FlareXes – for brainstorming, prompting, and crazy idea.
  • ChatGPT – for actually writing the script and README.md while I drank coffee. ☕

About

Trigger duckduckgo search (with bangs) from Rofi with a single keystroke.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages