Keyboard shortcut and command line utility to switch display (Windows)

Feb 04, 2021

As I do most of my work on a wide external screen, I decided to increase my laptop's internal screen lifetime by switching it off. But sometimes, it is useful to have a small second screen to display conversations (WhatsApp, Discord, etc.) or program logs. I ended up using the settings app quite often to turn the internal display on and off.

As I'm constantly trying to find ways to optimize my workflow and reduce my usage of the mouse, I decided to create keyboard shortcuts to switch between both modes.

After a quick google search for a command line utility that I could use to create my keyboard shortcut, I found out about the win + P shortcut to open Windows 10's displayswitch menu (see image). Great! No need to create a keyboard shortcut, I can just use win + P, ⇑ to turn the internal display on and win + P, ⇓ to switch it off.

And you, what could you automate or improve in your workflow? The solution may be just a google search away.

Additional keyboard shortcuts

When the "extend" mode is activated, you move a window between screen using these shortcuts:

Shortcut Effect
win + shift + left arrow Send active window to screen on the left
win + shift + right arrow Send active window to screen on the right

Also, did you know that Windows 10 comes win a tiling windows manager?

Shortcut Effect
win + left arrow Tile window on the left (repeat to cycle)
win + right arrow Tile window on the right (repeat to cycle)
win + up arrow Maximize window or tile top (repeat to cycle)
win + down arrow Minimize window or tile bottom (repeat to cycle)

displayswitch.exe

For reference, here's how to use the command line utility to change the projection settings:

Command Effect
displayswitch.exe /internal Show only on internal screen
displayswitch.exe /extend Extend display on both screens
displayswitch.exe /external Show only on external screen
displayswitch.exe /clone Duplicate on both screens