Switch between PCs with multiple monitors and a simple KVM

Background

I have 2 PCs and 2 displays, and a modest KVM - which only supports a single screen.

Problem

Switching is cumbersome

Switching between the PCs used to involve:

  1. Switching the KVM, which took care of one display
  2. Using the controls on the 2nd display to switch it to a different input

One display's resolution and refresh rate is limited by KVM

While my displays both support  a high resolution and refresh rate, the one connected via KVM was not able to utilize these capabilities.

Solution

  1. Use the NirSoft freeware ControlMyMonitor
  2. Create a batch file to switch screens (one on each PC)
  3. Use a shortcut on the Windows taskbar
  4. Assign a keyboard shortcut (e.g. CTRL+Alt+0)
  5. You can switch by:
    CTRL+Alt+0 plus whatever switches your KVM (which still switches the mouse and keyboard)

How to

I created a batch file on each PC and saved it next to controlMyMonitor.exe, which I placed under program files.

Here is the contents of the batch files:
 

On PC1:

@echo off
cd ~dp0
controlmymonitor /SetValue primary 60 18
controlmymonitor /SetValue secondary 60 18

On PC2: 

@echo off
cd ~dp0
controlmymonitor /SetValue primary 60 15
controlmymonitor /SetValue secondary 60 17
Note see below for how to obtain the correct values
 
Here is the configuration of the shortcut I created:
Target contains:
C:\Windows\System32\cmd.exe /c "C:\Program Files (x86)\NirSoft\controlmymonitor\<batch fie name>"
This syntax ensures I can add this shortcut to the taskbar
Shortcut Key is configured so it's easy to use - pick any letter you find effective

Obtaining the right values for your setup

When creating a batch file, you need a set of numbers to control your displays.
Obtain these by launching ControlMyMonitor and letting it detect your displays.
 

  • 60 means "switch input"
  • 15,17,18 are specific to my setup, they are the input selection numbers

This information is displayed when you start switchMyMonitor interactively

 

Interesting stuff

While your displays are switched to one PC, the other remains connected and can, in fact, control them. for example, you could create a 2nd batch on each PC to quickly switch the displays back to it

Comments

Popular posts from this blog

Ansible and aws: adding hosts to known_hosts

Mac OS: Log-foo