Out of habit from using Ubuntu, to focus Google Chrome I hit the Start Menu button and type "ch" (which autocompletes to Chrome) and hit enter to open Chrome. This is faster than using Alt+Tab and using mental energy trying to find Chrome window. However in Windows 10 this always opens a new window and I'm left with a bunch of windows open and a cluttered desktop.
To mimic the behaviour of opening Google Chrome from macOS's Spotlight or Ubuntu's start menu where if you already have a Google Chrome instance, it will focus the open window rather than create a new window. Windows 10 by default always open a new Chrome window from the start menu.
- Create a Windows Powershell Script in any directory called
chrome.ps1
. Example:C:\Users\<USERNAME>\Documents\chrome.ps1
- Copy the contents of the
chrome.ps1
file in this gist to your new file. - Remove Google Chrome from your Start Menu.
- Create a Windows Powershell shortcut to your Start Menu. Powershell is located in
C:\Windows\System32\WindowsPowerShell\v1.0
. The start menu folder is located inC:\ProgramData\Microsoft\Windows\Start Menu\Programs
. - Rename the Powershell shortcut to
chrome
. - Right click the Powershell shortcut named
chrome
and openproperties
. - In the
Shortcut
tab:- edit the
Target
property toC:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -windowstyle hidden -ExecutionPolicy Bypass -File "C:\Users\<USERNAME>\Documents\chrome.ps1"
(make sure to use the correct directory where your powershell script is located). - edit the
Run
property toMinimized
- edit the
- Save the property settings. Done!
Hit the Start Menu button, type "ch" and open your "chrome" powershell script shortcut. You may have to manually click it at first to make it rank higher on your Menu index.