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
- DuckDuckGo bang support by default
- Local prefix overrides for custom search engines
- Single-input workflow
- rofi
- jq (optional, for URL encoding)
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-ddgrofi-ddgEnter a search prefix followed by a query.
Examples:
g linux kernel→ Google search!y neovim tutorial→ YouTube search
! doesn't matter.
For best experience, bind the script to a key combination according to your desktop environment or window manager. E.g.:
Add the following to your hyprland.conf:
bind = SUPER, SPACE, exec, rofi-ddgBy default, the script uses xdg-open.
You may edit the script to change browser:
BROWSER="firefox"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
%sis replaced with the URL-encoded query
Local overrides take precedence over DuckDuckGo bangs.
I would like to thank: