iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🛫

Quickly Launching GitHub Copilot on Windows

に公開

This is a quick tip 🍣

I recently purchased a Thinkpad E14 as my personal Windows machine, and this PC has a button to open Microsoft Copilot (it seems to be called the Copilot key).

https://support.microsoft.com/en-us/windows/675708af-8c16-4675-afeb-85a5a476ccb0


Copilot key

The behavior of this button can be changed from Settings > Personalization > Text input, but the settings are not very flexible.


Available settings

Since I regularly use GitHub Copilot and am subscribed to the Individual Plan, I wanted to change the assignment of this button to open it more easily. I couldn't get a good answer even when asking generative AI, so I decided to make a note of it here 📝

What I'm doing is quite standard, so it should be applicable when you want to open other generative AI services or any web app in a nice way.

What I Made

Install Microsoft PowerToys and enable Keyboard Manager.
If you use a PC with a US keyboard layout, you might be familiar with this for reassigning keys like the conversion keys.

https://learn.microsoft.com/en-us/windows/powertoys/

This time, we will use Remap a shortcut instead of Remap a key.

https://learn.microsoft.com/en-us/windows/powertoys/keyboard-manager#remapping-shortcuts


Shortcut remapping screen

Once you open the screen, first select the key you want to assign.
When I clicked the pencil icon and pressed the Copilot key, in my case, it was recognized as Win(Left) + Shift(Left) + F23.

Next, specify the following for each mapping target:

  • Action
    • Select Run Program
  • App
    • Specify C:\Program Files\Google\Chrome\Application\chrome_proxy.exe
      • chrome_proxy.exe is the program used when creating a PWA with Google Chrome.
      • The installation path might differ depending on your environment, so please adjust it according to your machine.
  • Arguments
    • Specify --app="https://github.com/copilot"
      • This specifies the initial page to be displayed when the PWA starts.
      • Other options like the ones here also seem to be available if needed.
  • Others can be left as default or optional.

https://kabrog.hatenadiary.jp/entry/2023/10/06/181315

If you turn GitHub into a PWA while it's open in Google Chrome, you cannot set the initial page at startup (it refers to the manifest.json specified by GitHub for the PWA). However, with this method, you can apparently launch any arbitrary page at startup.

Let's actually try pressing the Copilot key.
It works perfectly 🐤


GitHub Copilot as a PWA

That's all 😌

Discussion