Skip to content

Daydreamer-riri/PowerToys-Run-WebSearchShortcut

Repository files navigation

PowerToys-Run-WebSearchShortcut

This is a simple PowerToys Run plugin for quickly select a specific search engine to perform searches.

Preview

search-preview

Keyword

If you have configured the 'Keyword' field, you can use the abbreviation keyword to specify the search engine.

Requirements

  • PowerToys minimum version 0.79.0

Configuration field

Url

The URL template for performing the search. Use %s as a placeholder for the search query. If the Url does not contain %s, the Url will be opened directly when you press enter.

Keyword

Used to quickly select the target search engine.

SuggestionProvider

Used to set the search suggestion.

SuggestionProvider currently supported are:

  • Google
  • Bing
  • Npm
  • CanIUse

PR welcome!

You can also set a Provider to another search engine. eg:

{
  "StackOverflow": {
    "Url": "https://stackoverflow.com/search?q=%s",
    "SuggestionProvider": "Google"
  }
}

IsDefault

If this option is true, the corresponding search engine does not need to input the trigger word.

IconUrl

You can customize the icon by setting this field. Under normal circumstances, you don't need to set this, as the plugin will automatically download the favicon of the website corresponding to the Url field. However, sometimes you might want to customize the icon, and this field comes in handy. Note: This field can only be set to a network URL and cannot be set to a local file.

Installation

  • Download the latest release by selecting the architecture that matches your machine: x64 (more common) or ARM64
  • Close PowerToys
  • Extract the archive to %LOCALAPPDATA%\Microsoft\PowerToys\PowerToys Run\Plugins
  • Open PowerToys

Config

  • Open config file:

config

  • Inside the config file, you can add your desired search engines. The key is the display name of the search engine, and the url property is the URL template for performing the search. eg:
{
  "Google": {
    "Url": "https://www.google.com/search?q=%s",
    "SuggestionProvider": "Google"
  },
  "Bing": {
    "Url": "https://www.bing.com/search?q=%s",
    "SuggestionProvider": "Bing"
  },
  "GitHub": {
    "Url": "https://www.github.com/search?q=%s"
  },
  "GitHubStars": {
    "Url": "https://github.com/stars?q=%s",
    "Keyword": "gs"
  },
  "StackOverflow": {
    "Url": "https://stackoverflow.com/search?q=%s",
    "Keyword": "st"
  },
  "npm": {
    "Url": "https://www.npmjs.com/search?q=%s"
  }
}
  • Run reload:

reload

Roadmap

  • Keyword field
  • Search suggestions

Credits

  • This project can only be completed under the guidance of this article. Thanks to @hlaueriksson for his great work.

  • The search suggestion feature of this project is based on the relevant implementation of FlowLauncher, thanks @Flow-Launcher!

License

MIT License © 2023 Riri