microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.46k stars 6.45k forks source link

[Run][New Plugin] Web search #3245

Closed mrlacey closed 2 years ago

mrlacey commented 4 years ago

Summary of the new feature/enhancement

I want to be able to start a web search from the launcher. Ideally, I'd type bing power toys and it would navigate to https://www.bing.com/search?q=power+toys in my default browser. google power toys would go to the equivalent.

The ability to specify the keyword/search engine to use and the domain it goes to would also be necessary. Not only would this enable supporting other search engines, but it would also allow for people to adjust for different TLD versions of search engines.

This would be similar to functionality that used to be available in Enso launcher.

Proposed technical implementation details (optional)

This would presumably require some settings for determining which words are identified as initiating the search and the URL to submit the query to. This could also be the base for similar functionality where a keyword could launch an app and pass other values as command-line arguments. Without additional arguments, this could also serve as a way to create aliases for apps so they could be launched with a small number of keystrokes.

crutkas: possible solution to this issue in #10619. It defers to default browser + user's search engine. Lets PT Run be generic

samwzlim commented 3 years ago

For people looking for a quick fix, here's an autohotkey script that will replace qq with the google search URL inside powertoys run.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#IfWinActive, PowerLauncher
:*:qq::https://www.google.com/search?q=

This works great! Is there any way to speed up the text being written out? For example, after I type 'qq', I want to be able to write something else instantly without needing to wait for the text to be written out completely.

khateeb321 commented 3 years ago

I have a very basic version of this ready I'm using for myself. If it's likely to be merged I can create a PR for this.

4C3rXRDDgN

Looks amazing!!

moishinetzer commented 3 years ago

Are there any updates on this being worked on? Is there a current release this is planned to be in?

msc94 commented 3 years ago

Please look at this branch for a starting point: https://github.com/masi456/PowerToys/tree/add_websearch

I guess about half of the work is done (the functionality). What this needs before I can open a PR is some polishing like adding translations, exposing configuration options etc. Unfortunately I'm very busy atm but once I find some time I will try to make a PR. If someone else wants to give it a shot based on my branch, go ahead.

crutkas commented 3 years ago

TLDR: Plugins could work now for a community member, we need to put in a lot more thought into making the plugin system more robust a plugin doesn't break PT and PT updates won't break plugins. PT does not believe this will be a plugin we will build but keeping it open so we build out support to enable it correctly

@moishinetzer PT team has work to do for enabling plug-ins for community. We've been building out the systems to support community plugins that ship outside of PowerToys Run but right now i don't think we have everything in place really. Can it be done, 100% as the engine itself is plugin based (and based off of Wox). All our modules are actual plugins.

But questions like @Irnv raise we haven't spent time to address and really dig down and validate we have a robust system yet to talk about it. Here are just some off top of my head i think we'd really want answered before we start saying we're ready:

Work that would need to be done:

When we look at this targeted plugin, would it be a plugin we'd include in the core of PT? Honestly, no. My take on this is can we abstract the concept out for flexibility and be good citizens to any supporting item's business core. Here, I don't think we can abstract well nor be good citizens. I look at @masi456 and the interaction model and think it is great way to think about the problem. I also see an open question of how someone properly launches that query. Does the owner of that service want that style of interaction. More so, I could instantly see a group of users asking "Hey, can we get the results in the dropdown?" which is a valid question. That then pushes a lot of my open questions above. Search engines make some of their profit off ads, how does this interaction model work then, would some results be ads? If no, does that mean we have API keys that then would have rate limits? Now scale that to any engine someone would request since this is not something we can abstract out easily and parse results. We have to be respectful of their business and service model. Not just deep link even if that is possible.

lrnv commented 3 years ago

@crutkas Thanks for the extensive explanations.

Maybe a workaround is the following: until a proper marketplace mechanism or something else that allows to use plugins shipped outside of PT, even if you do not want to make this one a built-in plugin, you could make it built-in and disabled by default so that we can still use it ? A little like what was decided for the VS Code plugin, which is also from the community.

PT RUN is a launcher, it should be able to launch things. Users of PT are by definition power users, people that want to modify their tools to improve their workflow. Hence, a plugin-based launcher makes a lot of sense. It makes so much sense that the number of PT RUN plugins is already increasing from release to release, and the community starve for more.

Maybe this behavior (merge community plugins and disable them until a proper marketplace is constructed, at which stage maybe throw them out) could be the default.

I understand that the whole marketplace is a lot of work to implement and that it might take time.

pota2dev commented 3 years ago

I have a very basic version of this ready I'm using for myself. If it's likely to be merged I can create a PR for this.

4C3rXRDDgN

Can you please give details on how you did this?

eytanschulman commented 3 years ago

Just wanted to add here that this is a built-in basic functionality of Alfred on the Mac. There has obviously been a lot of excitement and request for this feature over the past year (Dozens of duplicate issues, and a lot of conversation). Once this functionality is added, and custom web searches can be implemented, I personally will finally have a great reason to start using PowerToys.

S-Spektrum-M commented 3 years ago

I think this would be pretty trivial since Wox(what powertoys run is based on) supports this feature.

riotrah commented 3 years ago

@crutkas I thank you as well for your explanations.

I ask then, why do you not consider this a feature worth in-housing? What is it about this feature that disqualifies it, and what is it about vscode workspaces search or registry editing that qualifies them? Is it primarily the revenue generation? If not, I'd appreciate knowing what the team's criteria looks like, if it makes sense to disclose.

How about if there was in-house support for custom macros/templates? That, combined with the existing URL opening feature, would allow us to recreate this feature ourselves without explicit endorsement. With the autohotkey script posted above. this already looks like a feasible way to implement the feature, albeit with poorer UX than if done within Run.

crutkas commented 3 years ago
  1. Existing plugins
    1. Registry is an item that makes sense for power users and is built into Windows.
    2. Code is one that was designed to be removed when we support plugins more formally. It was a community plugin PR.
  2. We have a tracking feature to support macros and what not. Right now we're fixing bugs & stabilize the core. 100% happy to partner if you'd like to grab an oar with us :)
    1. I look at what @masi456 is great from a community stance great but what may be a neater implementation that is generic and scriptable is to have a user generated table of action + queries. You'd type b foo and it works how you scripted it versus PT having to know everything at compile time. This scales far more since if you want duck duck go for instance, PowerToys code base doesn't have to be aware, you just do it. This would enable you as a user to be empowered to use whatever you want.
am7n commented 3 years ago

I have a very basic version of this ready I'm using for myself. If it's likely to be merged I can create a PR for this. 4C3rXRDDgN

Looks amazing!!

omg this is simply what i want n i believe im not alone. how can i do this?

pollau commented 3 years ago

What is the status of this today?

jamilhaddadin commented 3 years ago

I have a very basic version of this ready I'm using for myself. If it's likely to be merged I can create a PR for this. 4C3rXRDDgN

Looks amazing!!

omg this is simply what i want n i believe im not alone. how can i do this?

can you share it please :-)

phi3nix commented 3 years ago

I have a very basic version of this ready I'm using for myself. If it's likely to be merged I can create a PR for this. 4C3rXRDDgN

Looks amazing!!

omg this is simply what i want n i believe im not alone. how can i do this?

Can you share this with us?

jfpaccini commented 3 years ago

I have a very basic version of this ready I'm using for myself. If it's likely to be merged I can create a PR for this. 4C3rXRDDgN

Looks amazing!!

omg this is simply what i want n i believe im not alone. how can i do this?

can you share it please :-)

please please please !!! πŸ™πŸ™πŸ™

TobySkarting commented 3 years ago

For those who is looking for @masi456's work

please see https://github.com/microsoft/PowerToys/issues/3245#issuecomment-806714780

andrewpros commented 3 years ago

In the current state, what is even the point of using PT Run anyway instead of other software that does everything PT Run does and more and supports searching in browser, yt and others. I use PT only for the Run functionality, so its better to use just something that works already, cuz why not.

More than a year has passed and this is STILL not possible, if so simple things takes that much time, there is just no point waiting, and this is not the only thing thats missing, when will we see this and the ability to fully customize/theme the whole search action window to our liking, ppl are basically begging for a year for this.

This is simple and crucial functionality, yet still not there, clearly the current state of things makes it impossible to add basic things like that whatever the reason is, i understand some things cannot be added right away, but cmon, its at least 1 and a half year and still nothing, to call it a disappointment is like saying nothing.

mreduar commented 3 years ago

So there is still no acceptable solution for this?

JTApps-1 commented 3 years ago

Please provide addon to search using default search provider string. It could be as simple as providing a direct activation character like you do now, such as ":" or "/" an let that represent the default search provider query string. Then concatenate the search phrase. This should invoke the default browser and the preferred search engine.

For example, my preferred search engine and browser is Edge/Bing. When I want to do a quick search using PT Run, I invoke the PT Run text box and quickly paste "https://www.bing.com/search?q=". I have this pinned to the windows clipboard cache. Then I start type my search terms. This is not preferrable as it takes multiple actions, but it is faster than opening browser and then searching. It would be better if you implemented as add-on.

Better yet, empower us to create simple add-ons like this scenario. it would be great if I could click an "+" sign in PT Run's setting to configure/install my own add-on.

Further, you should consider having an add-on cache where anyone could upload an add-on to be shared with the community. You could host it on Github or PowerShellGet or something like that.

kenbailey commented 2 years ago

Many browsers support a command line option to be passed with the "?" to cause a search phrase to open a new browser window (e.g, Firefox, Chrome, Edge). I would still vote for a shorthand of this, but in the meantime I use the -- command line parameter separator to accomplish this.

For example: firefox -- "? my search phrase"

The shorthand as I don't have other apps that start with "fi" I just do the following: fi -- "? my search phrase"

Don't forget the quotes around the "?" and search phrase. Happy searching.

crutkas commented 2 years ago

@kenbailey we've discussed that as a possible solution to this issue in https://github.com/microsoft/PowerToys/issues/10619

liflovs commented 2 years ago

Still firefox -- "? my search phrase" this is a lot to type. Shorthand like "s search term" is what most want. I just hope there are no "political" reasons in not implementing it, only technical.

pfinnn commented 2 years ago

this would be a very valuable feature for the run tool.

shirkerohit commented 2 years ago

It's sad to see this awesome feature is still missing from the list and this ticket is still open for so long time. 😬

nhamilakis commented 2 years ago

This would a very cool feature to have, i work a lot with Linux, and we have rofi that is completely modular, and you can link commands to scripts and a web search keyword is super easy to add, so this type of modularity for me, it's a must in a run tool. Also, the only web search available on Windows is the default windows menu, but it doesn't allow switching browsers it only allows edge web search, and also it's not configurable at all.

carter-lavering commented 2 years ago

Also, the only web search available on Windows is the default windows menu, but it doesn't allow switching browsers it only allows edge web search, and also it's not configurable at all.

There's a tool called EdgeDeflector that will let you configure which browser those microsoft-edge: links open in! Works flawlessly, highly recommended.

liflovs commented 2 years ago

@carter-lavering but it uses bing, so if dont want to use bing that would require to also put some redirecting extension in browser :)

JTApps-1 commented 2 years ago

I know we want to support all our different search engines, but I just want the feature we are discussing.

Bing is a very capable search engine, so I have no issues with using it.

Please do not let the lack of support for other search engines delay the feature.

That can always come later.

Regards,

-JT


From: Serhii @.> Sent: Monday, September 27, 2021 11:11 AM To: microsoft/PowerToys @.> Cc: JTApps-1 @.>; Comment @.> Subject: Re: [microsoft/PowerToys] [Run][New Plugin] Web search (#3245)

@carter-laveringhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcarter-lavering&data=04%7C01%7C%7Ccd67e38a462a4d5433d308d981c90472%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637683522644145001%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=uH%2BE5TUIfOdO6cqm2vLHbOKBMRpvs13UQz9q2CipGqc%3D&reserved=0 but it uses bing, so if dont want to use bing that would require to also put some redirecting extension in browser :)

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FPowerToys%2Fissues%2F3245%23issuecomment-927969388&data=04%7C01%7C%7Ccd67e38a462a4d5433d308d981c90472%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637683522644154991%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=mhXYqsri%2Fda6CwX9zUucC7Z4sK%2FS9oRmF6D2Fj0CnyI%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGEIZAAODPBFCBDS2DHPJPTUECCQJANCNFSM4NFO474Q&data=04%7C01%7C%7Ccd67e38a462a4d5433d308d981c90472%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637683522644164986%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=i0bc3ZqwOXK9tUGmunpLkEwYCB3e0JlwPZJyujgpSFo%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7C%7Ccd67e38a462a4d5433d308d981c90472%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637683522644164986%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=KxzfLHdLJo5foNup%2BcUjN%2Fs7zvIysW9cOIC8NEsz7Iw%3D&reserved=0 or Androidhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7C%7Ccd67e38a462a4d5433d308d981c90472%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637683522644174981%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=PEjJxxu7hqY3tlP2g57p4Qz%2Bqs2LAYbCEMey%2FqVB8pg%3D&reserved=0.

gioleppe commented 2 years ago

What's the status of this as of today? This feature is badly needed and it's a shame it's not a thing yet! It might be the single feature people is missing the most coming from macOS

jainal09 commented 2 years ago

Hey @franky920920 any updates in the search feature. Is it on the to do list ?

cwuethrich commented 2 years ago

It is not only about different search engines. I use launchy and have two different shortcuts for bing. b > hello world --> https://www.bing.com/search?q=hello+world w > hello world --> https://www.bing.com/work/search?q=hello+world

frank-dong-ms-zz commented 2 years ago

Hey @frank-dong-ms any updates in the search feature. Is it on the to do list ?

Sorry I have no context on this, are you contacting the right person?

jainal09 commented 2 years ago

Hey @frank-dong-ms any updates in the search feature. Is it on the to do list ?

Sorry I have no context on this, are you contacting the right person?

Sorry, my bad. I corrected the comment.

franky920920 commented 2 years ago

Hey @franky920920 any updates in the search feature. Is it on the to do list ?

Not sure about this..... @crutkas is this in our roadmap yet?

crutkas commented 2 years ago

With the proposed solution in #10619, it should be light weight and we have chatted about getting it on the schedule. Right now we don't have it on a sprint.

stewSquared commented 2 years ago

There's a lot of discussion complicating this feature by proposing extra keywords to choose a browser and search engine. That doesn't really save me keystrokes compared to simply launching the browser then use it's built-in search functionality to choose an engine.

I'd much prefer a single key to activate this plugin that simply launches my default browser and uses the query in its default search. / isn't taken yet.

cwuethrich commented 2 years ago

I'd much prefer a single key to activate this plugin that simply launches my default browser and uses the query in its default search. / isn't taken yet.

It is not only about search with a search engine. If we can define shortcuts, we could use them for translators, dictionaries, github, stackoverflow...

crutkas commented 2 years ago

@cwuethrich that is outside this direct request. That would be a variant I'd say of action word to shortcut

cwuethrich commented 2 years ago

@crutkas this is exactly launching a website with the default browser where a predefined part will be replaced. If we are able to do this, we could use every search engine and also many other websites. For example on stackoverflow: https://stackoverflow.com/search?q=power+toys

I want to be able to start a web search from the launcher. Ideally, I'd type bing power toys and it would navigate to https://www.bing.com/search?q=power+toys in my default browser. google power toys would go to the equivalent.

crutkas commented 2 years ago

@cwuethrich your ask is a variation of https://github.com/microsoft/PowerToys/issues/3600 IMO

nhamilakis commented 2 years ago

@cwuethrich your ask is a variation of #3600 IMO

i think it is more inline with this request since it corresponds exactly to what the original issue requests. In most browsers, web search can be configured by replacing URL query param (eg : https://stackoverflow.com/search?q=%s for Google), and this issue does request the ability to search the web.

sibber5 commented 2 years ago

I'd like to implement this. most of the work is already done in the uri plugin actually

crutkas commented 2 years ago

@cyberrex5 if you want to do it in the way I suggested, please. namely this comment from the intro of the issue

crutkas: possible solution to this issue in #10619. It defers to default browser + user's search engine. Lets PT Run be generic

crutkas commented 2 years ago

We added in 0.53. Head over to https://aka.ms/installpowertoys to try it out

Jay-Squared commented 2 years ago

The implementation does not actually implement the feature that was being asked for, namely to allow setting up multiple searches using search urls and keywords.

sibber5 commented 2 years ago

allow setting up multiple searches using search urls and keywords.

thats not really possible without some major changes to plugins api

rcmaehl commented 2 years ago

The implementation does not actually implement the feature that was being asked for, namely to allow setting up multiple searches using search urls and keywords.

I can create a solution for this if there's enough interest.

Edit: I've created a proof of concept over at rcmaehl/PowerToysMacros

image

mbaas2 commented 2 years ago

The implementation does not actually implement the feature that was being asked for, namely to allow setting up multiple searches using search urls and keywords.

I can create a solution for this if there's enough interest.

I'm interested!

cwuethrich commented 2 years ago

This issue shouldn't be closed. This feature isn't implemented now.