---
title: "One click DuckDuckGo"
description: "Search any text that is selected anywhere in the OS with DuckDuckGo in a single click! Practical notes and code examples on."
url: "https://h3manth.com/scribe/one-click-duckduckgo/"
canonical_url: "https://h3manth.com/scribe/one-click-duckduckgo/"
markdown_url: "https://h3manth.com/scribe/blog/one-click-duckduckgo.md"
publishDate: "2012-04-24T00:00:00.000Z"
author: "Hemanth HM"
category: "cli"
tags: ["linux","bash"]
word_count: 146
reading_time_minutes: 1
x_markdown_tokens: 312
content_signal: "ai-train=yes, search=yes, ai-input=yes"
---

# One click DuckDuckGo

> Search any text that is selected anywhere in the OS with DuckDuckGo in a single click! Practical notes and code examples on.

Check out the [ONE CLICK DDG DEMO](http://h3manth.com/ddg.ogg)

Search any text that is selected anywhere in the OS with DuckDuckGo in a single click is really fun!

Yes you read it right, may the text be in a document, webpage, terminal - anywhere you can imagine and select - can be searched with DuckDuckGo with a single click, using a simple one liner and some easy GUI tricks as in the video.

**Dependency:** xclip - command line interface to X selections (clipboard)

```bash
sudo apt-get install xclip
```

**The code:**

`xdg-open` opens a file or URL in the user's preferred application and in this case it's fetching the selected data from xclip and opening a browser that takes the help of DuckDuckGo to search.

```bash
xdg-open https://www.duckduckgo.com/?q="$(xclip -o)"
```

Trying to make a right click context menu from Gnome-Terminal - people who are interested can ping me!
