Giter Site home page Giter Site logo

quicksearch's Introduction

Quicksearch

Configurable quick search engine shortcuts for your terminal and browser.

Crates.io Crates.io License License

Installation

Run cargo install quicksearch to install

Configuration

Run quicksearch config to get the path to your config.

Here is an example:

{
    "engines": {
        "google": {
            "name": "Google",
            "url": "https://www.google.com/search?q=%s"
        },
        "yt": {
            "name": "YouTube",
            "url": "https://www.youtube.com/results?search_query=%s"
        },
        "ddg": {
            "name": "DuckDuckGo",
            "url": "https://duckduckgo.com/?q=%s"
        }
    },
    "default_engine": "ddg"
}

engines are required. This is a map between keywords and the search urls. %s is what will be replaced with your query.

default_engine is an optional setting for server mode that can be set to one of your engine keywords. If it is not set, unknown keywords will redirect to the quicksearch help page. With it set, your full query will be redirected to your default search engine. This allows you to use quicksearch as your default search engine in your browser.

Usage

Terminal

You can search YouTube with: quicksearch search yt Never Gonna Give You Up

Not quick enough? You can set an alias in your shell profile, eg. for zsh:

alias q="quicksearch search"

Then you can simply search: q yt Never Gonna Give You Up!

Still not quick enough? You can use the shell integration in your shell profile. eg. for zsh:

eval "$(quicksearch shell zsh)"

Then you can simply search yt Never Gonna Give You Up!

Browser

Run the server with quicksearch serve. By default the port is 7878, but you can set it with --port [PORT].

Add quicksearch as a search engine, and set a keyword eg. q to use it easily. For Firefox see here. For Chrome see here and set the url to http://localhost:7878/%s replacing 7878 with your chosen port.

At this point you can search YouTube with q yt Never Gonna Give You Up.

If you set quicksearch to be your default search engine, then you can simply search yt Never Gonna Give You Up. But any unmatched query will direct to the quicksearch help page. It is recommended to set default_engine in your config, so that any unmatched queries will fall through to your default search engine.

Autostart Server

Linux / MacOS

One option is to add to your crontab:

Run crontab -e to edit, then add @reboot ~/.cargo/bin/quicksearch serve.

Windows

Open the startup folder (Win+R then run shell:startup). In this folder, add a shortcut with pwsh -windowstyle hidden -c quicksearch serve as the location. You may need to replace pwsh with powershell depending on your version.

Alternatively, you could use Task Scheduler.

quicksearch's People

Contributors

skarfie123 avatar

Stargazers

Alex Ward avatar Monomadic avatar

Watchers

James Cloos avatar  avatar

quicksearch's Issues

map suggestion urls

as well as search urls, allow setting suggestion urls.
handle suggestion requests and redirect to the correct suggestion url.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.