Closed mrlacey closed 2 years ago
Yes! Also it would be great if I could just write a longer sentence/string and it would always default to web search when it doesn't find other results. So basically, it should be like Windows Search π
This function is very practical. Hope to realize it
Yes, just like Alfred on Mac does!
So basically, it should be like Windows Search
And it would be fantastic if it would leverage the system default browser's chosen search engine, instead of picking one for itself.
How about using a ? char to to switch to a web search mode like > goes to a shell?
that could be a shortcut to default search engine, but multiple ones should be supported with own keywords
Please give the option to disable this. Not everyone wants to automatically expose every local search query to a search engine on the internet.
This is, by the way, a big privacy insult in the windows start menu search, because you can't disable web search anymore.
See also #3420 that someone posted. I have a ton of web shortcuts in the browser and it would be nice to be able to run them natively in the launcher, optionally with the ? or # or other user defined character beforehand so powertoys understands I'm gong to be running a search engine. One thing to consider would be how it knows which browser to use - to further muddy the waters would modifiers launch a particular browse so '# c powertoys' launches chrome (the 3) and then runs the c shortcut to search chocolatey's website for powertoys. Using '? int passwords" would then launch edge to search the intranet for passwords (as an example)
Please give the option to disable this. Not everyone wants to automatically expose every local search query to a search engine on the internet.
This is, by the way, a big privacy insult in the windows start menu search, because you can't disable web search anymore.
While windows search automatically loads the results the proposed functionality here is having the option to search your query through PowerToys Run, but it would not do that automatically, you still need to hit enter on the web search option, so all your queries remain private unless you explicitly ask to open a browser and search on google.
One thing to consider would be how it knows which browser to use
The query "> url" already opens a url in the default browser, so I think the issue of detecting which browser to use has been already solved
it just uses system call run or anything like that and OS itself resolves that
Would love to see this:
With keywords b, g, d for doing a query in the corresponding search engines and listing the results.
As a last resort if nothing could be found, on enter send query to default search engine
, but it would not do that automatically, you still need to hit enter on the web search option, so all your queries remain private unless you explicitly ask to open a browser and search on google.
Yes, as a possibility it's a feature. I thought about getting web results as soon as you start typing or doing a web search automatically in addition.
I think it's a very dangerous idea to force web results in a local search without an option to disable it, like the Windows search is doing it since some versions. It's a possible way to leak information unwanted from your computer. You could disable web search in the past, but it was removed some versions ago. On macOS you can set the search providers for the search like you want: only local, with web search, with wikipedia,... That's the better approach and everyone can set it up like wanted.
One thing to consider would be how it knows which browser to use
The query "> url" already opens a url in the default browser, so I think the issue of detecting which browser to use has been already solved
Thanks for the tip! but You need to prefix it with "WWW" π . If I am not wrong! I think having identified that entered text is an URL opening that with the default browser will be a clean approach.
I am a big fan of the implementation of the web search functionality in Wox, where the user can define any random search using keywords and search URLs. So I have, for example, a web search to search Canadian case law using the https://www.canlii.org/en/#search/id={q}
search URL, and I can trigger that by typing "canlii" plus the search query, then there is another search in the English Wikipedia using "wen" and the https://en.wikipedia.org/wiki/{q}
search URL, or a third one searching in the German Wikipedia using "wde" and the https://de.wikipedia.org/wiki/{q}
URL.
There's lots you can do here. Rather than get bogged down in detail, how about this basic functionality for a first version:
<Alt><Space>
.<Enter>
, Power Toys Run does what it currently does. No change.<Ctrl><Enter>
, Power Toys Run opens the default browser, passes the string from the edit box to the default search engine and the search results are shown in the browser.This is roughly what Google Desktop for Windows used to do before it was discontinued. It gives us a quick way to search for something on the web. I suspect it's the primary use case.
The one complexity is that I'm not sure the user's default search engine is discoverable without custom code for each browser. In which case, one of the settings in Power Toys would be to choose a default search engine. Version 1 can have a list of pre-defined ones (not customisable) to keep it simple.
Version 2 can introduce custom search engines and more sophisticated ways of searching the web such as prefixing the search by a letter (alias) to use a particular web site eg
b <search string>
to search using Bing
w <search string>
to search Wikipedia
and so on. For this, the Settings
would allow the addition of aliases, such as:
Alias URL
b https://www.bing.com/search?q=%1
g https://www.google.com/search?q=%1
w https://en.wikipedia.org/wiki/%1
a https://smile.amazon.co.uk/s?k=%1
where %1
is replaced by the search term entered by the user.
For version 3, you could have the option of including web history as the user typed a search term.
@Praful
There's lots you can do here. Rather than get bogged down in detail, how about this basic functionality for a first version: ...
i think this is a great idea to have aliases. I like syntax of DuckDuckGo Bangs which have a leading !
to distinguish a command from a regular input.
info: https://duckduckgo.com/bang
Auto complete feature is necessary. Please see this issue: https://github.com/microsoft/PowerToys/issues/4531
One can get PTRun to launch web URLs using a work around. Just documenting it here for reference if other people search and hit this page.
Firstly. we need to choose a prefix. In my example below, I use g
as the prefix. Then, create an exe or batch file using this prefix, ie, g.exe
, g.cmd
or g.bat
. However, if it is a batch file, then PTRun will require you to specify the extension as part of the prefix. You can choose gl.exe
or web.exe
or whatever you like for your prefix/program. Just don't have it clash with another existing program or prefix.
Secondly, this prefix exe or batch file needs to be in your path environment. For this example, I use %LOCALAPPDATA%\Microsoft\WindowsApps
, but it works equally well if you choose C:\Windows\System32
(but I don't recommend it).
Finally, in order for PTRun to pass on the url parameter, we need to tell it to use the command processor with the >
prefix when calling it (as described in #3405 - @edhcah example with Notepad++ didn't work because notepad++.exe
wasn't in the path)
cd "%LOCALAPPDATA%\Microsoft\WindowsApps"
mklink g.exe "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
mklink chrome_proxy.exe "C:\Program Files (x86)\Google\Chrome\Application\chrome_proxy.exe"
(needed for Chrome to work)> g
> g wikipedia.com
or > g https://www.youtube.com/watch?v=dQw4w9WgXcQ
> g "? microsoft powertoys"
If you prefer to use the system default browser, or do not wish to create symlinks, then you can add this batch file into %LOCALAPPDATA%\Microsoft\WindowsApps
%LOCALAPPDATA%\Microsoft\WindowsApps\g.cmd
@echo off
set _url=%1
if /I "%_url:~0,4%"=="http" (
start "" %_url%
) else (
start "" https://%_url%
)
> g.cmd
> g.cmd wikipedia.com
or > g.cmd https://www.youtube.com/watch?v=dQw4w9WgXcQ
One can of course convert the batch file to a proper CLI exe or extend it to do a Google search, but this solution is merely an interim hack until PTRun has proper support for this feature. In the mean time, this same principle can be used for other browsers/programs/etc, etc. For example, you can modify this concept to launch python scripts (via python.exe in %LOCALAPPDATA%\Microsoft\WindowsApps
) or WSL shell scripts via wt.exe (eg. start/stop WSL httpd/MariaDB services from PTRun).
Tested working in version PT 0.19.2 / Chrome 83
I am just wondering, Why wouldn't I though about It, I had kept chrome as my startup program and had set my email domain as the default page. π€¦ββοΈπ€¦ββοΈ
I'd like to see functionality similar to Launchy, where a string is detected as potentially searchable and the actions available for that string appear below in the search results. Those actions could be customized by the user, including some of the more advanced cases I've read from everyone. i.e. Targeted browser, engine or as input to interpolation, lexing and/or semantic analysis.
This approach acknowledges privacy concerns for out of box functionality. Customization involving downstream analysis would be a risk for the user or org to take on.
Would love to see this as well! I think the ?
idea is particularly clean.
To throw in my two cents, I typically enjoy the Windows Search functionality, where a query that isn't recognized as anything else gets passed to a web search. I press one key, type my query, then hit enter and I immediately have the web results. I barely think about it. Only change I would make is browser/search engine choice. Obviously, restriction to Bing or Edge would be frowned upon in this project.
Yeah, I am expecting something like
and may be in setting we can have option to enable/disable web search!
something new? not possible to search with google at the moment?
The ability to define custom web queries is one of the simplest and most useful features for a launcher like this... see Wox or Alfred on Mac.
In my opinion custom alias should not have a hardcoded prefix like ! or ? or #. If people want that they can add them to their alias, but we shouldn't be forced to use them.
My two cents: A ? prefix would definitely be better than nothing, but personally I prefer having a dedicated "launch web search" keyboard shortcut. Shift+Enter (for instance) right after my query feels much faster than typing a question mark and an additional space at the beginning.
I think so a possible way to do so is get the query written inside the search box and add the selected search engine query to it. So for example if the user enters google power toys than the google keyword can be detected and removed. Than using the detected google keyword, the search engine link can be added into the ammended string, so it becomes 'https://www.google.com/search?q=power toys', the space is automatically replaced with %20 by the browsers. This can then be transferred to the shell where it will open the link up in the default browser
Please give the option to disable this. Not everyone wants to automatically expose every local search query to a search engine on the internet.
This is, by the way, a big privacy insult in the windows start menu search, because you can't disable web search anymore.
@kraoli
there shouldn't be a preview of the search, so the query only gets exposed when you press on it. but yes, an option to disable it would definitely be nice
edit: clarity
Definitely there should be the possibility like in Wox for Windows and Alfred for MacOS to just type a query and already get possibility to look it up on a preselected browser (PLEASE USE CHROME, NOT EDGE) most importantly when the query does not match any other possible request e.g. looking for a file, app, etc.
I think that adding the keyword like (g what is.....)would be a waste of time because it's faster and more practical to just write what you are looking for.
Maybe also add the possibility to search for a query on private tabs
+1 for this feature.
I would like this to work similarly to Alfred (on mac): if your local search does not return anything, hitting enter will launch the browser, and search your query on google.
A toggle for this makes sense as well :)
+1 for this feature. This should definitely be an option.
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=
@crutkas @enricogior Would you be comfortable with me porting the Wox.Plugin.WebSearch, as I did with Wox.Plugin.Sys?
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=
How would we run this in Power Toys Run?
How would we run this in Power Toys Run?
@engrbugs The macro replaces the current query text (iff PowerToys Run is the active window) with the basic Google search query string. Then you can type your query and press Enter. PowerToys Run detects it as a URL and opens it in the browser.
@micahmo Thanks! I installed AHK and put the scripts in the Windows Startup folder. I added some in the script:
#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=
:*:tt::https://www.thesaurus.com/browse/
:*:yt::https://www.youtube.com/results?search_query=
@micahmo Thanks! I installed AHK and put the scripts in the Windows Startup folder. I added some in the script:
#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= :*:tt::https://www.thesaurus.com/browse/ :*:yt::https://www.youtube.com/results?search_query=
What is AHK and @micahmo, how to implement this. Is this a script that just needs to be put in notepad and saved. But then what is the extension of the script to be saved. Is it so that it is a script that when put in the startup folder, launches at startup, checks if power run is the active window and then replaces the text 'qq' with the google search url? What is the extension of the script and what is AHK?
@cursedsoulofgods
What is AHK
AHK or AutoHotkey is a powerful scripting utility, most often used for macros and custom keybinding. Download here.
Is this a script that just needs to be put in notepad and saved.
Yep.
But then what is the extension of the script to be saved.
AutoHotkey scripts have .ahk
extension.
Is it so that it is a script that when put in the startup folder, launches at startup
Exactly. To activate a script, you just run it (assuming the .ahk
extension is linked to the application), or put it in the startup folder so that it runs automatically. You should also see an icon the system tray for each active script, where you can pause/quit/etc.
checks if power run is the active window and then replaces the text 'qq' with the google search url?
Yes, that's what @smuun's script does when active.
BTW, Windows startup folder is either %appdata%\Microsoft\Windows\Start Menu\Programs\Startup
for the current user, or %programdata%\Microsoft\Windows\Start Menu\Programs\StartUp
for the all users.
In reply to @micahmo reply to my comment
assuming the .ahk extension is linked to the application
What do you mean by the AHK being linked to the application? Are there any special procedures for it?
@cursedsoulofgods
assuming the .ahk extension is linked to the application
What do you mean by the AHK being linked to the application? Are there any special procedures for it?
Sorry, I should've omitted that statement as it's more confusing than helpful. :) If you install AutoHotkey, it will automatically become the default application for .ahk
files.
@cursedsoulofgods
assuming the .ahk extension is linked to the application
What do you mean by the AHK being linked to the application? Are there any special procedures for it?
Sorry, I should've omitted that statement as it's more confusing than helpful. :) If you install AutoHotkey, it will automatically become the default application for
.ahk
files.
Ok thanks @micahmo
Hey guys, I created a Python script for those who do not like AutoHotkey running in the background. Here: https://github.com/engrbugs/powertoys-run-browse
Hey guys, I created a Python script for those who do not like AutoHotkey running in the background. Here: https://github.com/engrbugs/powertoys-run-browse
Hey @engrbugs I went through your script. What it really does it that it launches the browser. No offense, I find your script to be kinda useless. Not being rude here, the thing is one can simply type their browser name and search or they can just type "www.google.com" and search. So yeah, maybe if you can collect the keyword inside the search box and then pass it would be much more helpful because what you have done is just simply made an app that searches, nothing else. Please work on it. I really appreciate your effort into this, thanks!
Hey guys, I created a Python script for those who do not like AutoHotkey running in the background. Here: https://github.com/engrbugs/powertoys-run-browse
Hey @engrbugs I went through your script. What it really does it that it launches the browser. No offense, I find your script to be kinda useless. Not being rude here, the thing is one can simply type their browser name and search or they can just type "www.google.com" and search. So yeah, maybe if you can collect the keyword inside the search box and then pass it would be much more helpful because what you have done is just simply made an app that searches, nothing else. Please work on it. I really appreciate your effort into this, thanks!
None was taken. Thank you for the feedback. As I said, this is not for everyone. I created this script because I do not want AHK running on my background. Thus, I am this sharing and open-sourced to everybody.
Hey guys, I created a Python script for those who do not like AutoHotkey running in the background. Here: https://github.com/engrbugs/powertoys-run-browse
Hey @engrbugs I went through your script. What it really does it that it launches the browser. No offense, I find your script to be kinda useless. Not being rude here, the thing is one can simply type their browser name and search or they can just type "www.google.com" and search. So yeah, maybe if you can collect the keyword inside the search box and then pass it would be much more helpful because what you have done is just simply made an app that searches, nothing else. Please work on it. I really appreciate your effort into this, thanks!
None was taken. Thank you for the feedback. As I said, this is not for everyone. I created this script because I do not want AHK running on my background. Thus, I am this sharing and open-sourced to everybody.
No problem buddy. Also, I am pretty new to github so what does "None was taken" mean?
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.
@masi456 before opening a PR, can you open a new issue dedicated to discuss the details of your implementation? It would be useful if you can document the design and what configuration options it supports.
It would be great to have an option in settings to make your own custom search queries for example "a QUERY" to search amazon, or "y QUERY" to search youtube and such
It would be even better to support (optionally) using your default browser's custom search engines as well, as someone who uses "g" then tab for Google search, "yt" then tab for YouTube, "maps" then tab for Google Maps, etc. in order to prevent the step of duplicating all of those across into PowerToys.
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 tohttps://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