microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.33k stars 6.44k forks source link

[Run] Switch to running app instead of opening a new one #5962

Open AtaTrkgl opened 4 years ago

AtaTrkgl commented 4 years ago

📝 PowerToys Run Auto Focus

PowerToys opens a new instance of an app even if there is an instance. Focusing on that instance instead of opening a new one would be quite handy. Maybe a checkbox for toggling this behaviour?


If you'd like to see this feature implemented, add a 👍 reaction to this post.

htcfreek commented 4 years ago

You can search for open windows in PT Run.

AtaTrkgl commented 4 years ago

A toggle for making that function replace the default of opening a new instance is what I am requesting.

crutkas commented 4 years ago

this could get quirky i think.

martinchrzan commented 4 years ago

What if you already have multiple instances running? Which one would be activated?

AtaTrkgl commented 4 years ago

What if you already have multiple instances running? Which one would be activated?

In that case just like how it is right now, we can have multiple buttons for each instance without the new instance button,

wondering639 commented 3 years ago

Switching to an existing instance instead of opening a new one makes really sense to me. Think about applications like mail programs, browsers, chat programs etc. usually you don't want multiple instance of them and usually you switch to them multiple times a day. further, many applications have tabs, so you don't need a new instance. typing "< name" instead of "name" works, but costs you time. and you need to be aware if an instance is already open or not. as a user, I just want to get the application. That's a little bit like Depdendency Injeciton in programming: I don't care how it is created, I just want to use the service (application). Create a new instance if there isn't one yet, otherwise give me the existing one.

djpeach commented 3 years ago

This is how alfred works on mac and this feature alone is why I use KeyPiranha

djpeach commented 3 years ago

You can search for open windows in PT Run.

I see than I can go down to find the existing windows, but yeah that is annoying. I would love to have the option at least to open existing windows instead of opening a new one. This is problematic for apps that won't run more than one instance. It just flashes orange in the taskbar, but stays in the background even if i try to use the "open new window" default option.

What if you already have multiple instances running? Which one would be activated?

What Alfred on Mac does, is focus all of them. I've never been bothered by this, and in fact if I have 3 chrome windows open and I do cmd+space, then type "chr" and it pulls them all up over my various monitors, often that is exactly the workflow I needed. I can always just really quickly do cmd+space again and pull up other programs I was using after i am done with chrome, without ever moving my hands from the keyboard.

I am trying to make the long-term switch from mac to windows, and its great to see this super powerful tool being built by microsoft.

wjbuys commented 3 years ago

For me, it would be enough if I could configure the WindowWalker plugin to be a higher priority than the Program plugin. I think that should ensure that with the same search text, the "switch to window" action would be the default, instead of having to down-arrow to the bottom of the list:

image

vladdeSV commented 3 years ago

This issue is similar to one already created in the Wox repo: https://github.com/Wox-launcher/Wox/issues/1922.

I'll quote myself, https://github.com/Wox-launcher/Wox/issues/1922#issuecomment-449648777, explaining why suggesting to switching to an activate an application before launching a new instance is more desirable:

With Alfred, to open Spotify I did the following:

  • Opened Alfred (alt + space)
  • Pressed the S-key (s)
  • Pressed enter (enter)
chrobs commented 3 years ago

This is really a feature I want to have in PT Run from the beginning 👍

I came from ROFI window switch on linux and they are prioritizing the running applications in the search results (at least optional). Furthermore, ROFI has an option for History-based ordering: last 25 choices are ordered on top based on use.

This would be incredible valueable in my daily work, as already pointed out by @wondering639 and @djpeach !

Just a word to differentiate this to #3169: The current filter option does not adress this request here but makes it worth. Let me explain shortly.

The task is easy: Get a Terminal (Outlook, Teams, Chat, Powershell, whatever tool you use frequently) to focus or open it if it wasn't opened already.

Steps with the new feature: 3 Steps for both scenarios (with Terminal already running or not)

Steps in PTRun default: 4 Steps

Steps in PTrun with using the filters: 6 Steps

chrobs commented 3 years ago

@crutkas do you see any update here or any chance of getting someone to look into it?

We would really appreciate! Thanks in advance :)

Soneji commented 3 years ago

Copy of my post over at #3169

Hi all

Thanks for the work on this. I too would like this sort of behaviour, and while the option to type < before every search works, I still believe that we should be able to change the priority, the order in which these plugins run.

For example: I have set the activation phrase for Program to a . and I have unset the activation phrase for window walker, however these are still the results I get

image

I would want to have the existing instance show up as opposed to a new instance being created.

This means that the Program plugin is given priority over the Window Walker plugin. As a user, I would want to change this priority.

Could this maybe be reopened as I believe we still haven't achieved the original request, "option to let running programs be first in the results list". @moxwel

chrobs commented 3 years ago

Hi all, @crutkas @enricogior

sorry to bother you, but it is possible to get any hint if this enhancement has any chance of beeing implemented in the near future?

Thanks for your efforts!

KnifesmithCode commented 2 years ago

I think that a great way to implement this feature would be to have a "priority" list for all installed plugins. Number one gets first priority, then two, and down the line. Granted, I haven't looked at the codebase to see if implementation is possible, but I think that would be the optimal solution. That way, every user could configure their own order for results.

vladdeSV commented 2 years ago

Is this feature implemented? @AtaTrkgl

AtaTrkgl commented 2 years ago

Is this feature implemented? @AtaTrkgl

Thought it was but turns out I opened a single-instance app :p

josephan commented 2 years ago

I missed this feature in macOS and Ubuntu and I came up with this workaround: https://gist.github.com/josephan/cd399794dac11d619f56175d9332f307

Basically you run a powershell function that opens an existing chrome window. If it doesn't exist it creates a new one. It's not very elegant but it beats a cluttered desktop.

AvatarSenju commented 1 year ago

I found a simpler workaround by increasing the priority of window walker very high, like 1000, causing the first result to be already existing instance instead of new launch

TheJoeFin commented 11 months ago

I think this functionality could be improved by searching for the application name in addition to the text of the title bar. Like if I am searching for Outlook to switch to the open instance of Outlook I have to search for "mail -" and it works, when I search Outlook the window is not found and a new instance will be launched.

Jackiexiao commented 6 months ago

any progress or any better workaround ?

axelthat commented 5 months ago

This should really be implemented. Any updates?

e1turin commented 5 months ago

'Result ordering tuning' tweak is not helpful in my case: 'Application' still appears higher than window with running app. I also want to walk to an already opened window instead of running another one. Maybe it's simpler to suggest tweak for default command in PT Run? So, let it put < every time and I will remove it if it's not required. ☕

Are there any similar issues/enhancements?

Experiment59 commented 1 month ago

Would also love this feature. Coming back to Windows as a long-time mac power user, I was overjoyed to find PowerToys but really disappointed that it doesn't have this easy refocusing behavior. It's so much easier to open Spotlight/Alfred/a PowerToys Run-style bar, type the first few letters of your desired application and then hit enter to have it refocus it, rather than alt-tabbing through a crowded and hard-to-read list of windows.