Unify your Windows/Mac setup through software for šµ $0
š The situation
I spend most of my time on my computer. Pretty much every minute Iām not sleeping Iāll be sitting (or standing if Iām feeling especially active that day) in front of my computer. Iām a software engineer, but I also love games, particularly PC games. So I have this cool PC that Iāve built, with a fancy ultra-wide 144hz monitor that I absolutely love.
My company also provides a really nice Macbook Pro thatās very powerful and all my work is done there. Great machine, really expensive. Since I already have such a nice PC setup, I pretty much refuse to work on the tiny laptop screen with its questionable keyboard and trackpad setup. Thankfully, smart engineers have figured out a great way to fix that issue: Keyboard, Video and Mouse switches, also known as KVMs.
š The problem with KVMs
I have several issues with KVMs:
They sit in front of your devices, often adding a tiny bit of input lag to each of them. I play games pretty competitively and Iām always looking to reduce latency as much as possible, so thatās a pretty big no-no for me.
They often (if not always) donāt support the high resolution/high refresh rate that my gaming monitor offers. If youāve ever used 144Hz, you know you canāt go back to 60Hz, especially not voluntarily.
They get pretty darn expensive pretty darn fast. Iām all for spending money for high-quality products, but given the two caveats above, I simply canāt bring myself to splurge on one.
š¾ The solution: software
As is often the case, most of these problems can be solved purely through software for the low low price of $0, which sits pretty well with me.
Note: You still need at the very least one display cable for each of your machines and a monitor that allows you to plug multiple inputs into it. As far as I can tell, thatās pretty much every single monitor nowadays, but still.
āØļøš±ļø Keyboard and Mouse using Barrier
You may be familiar with Synergy, which is a paid solution that allows you to use your keyboard and mouse on multiple computers seamlessly. What you may not know is that there is an open-source variant of it (originally forked from Synergy!) called Barrier that is entirely free. It may have a little fewer features than its paid counterpart, but as long as it allows me to use my mouse and keyboard on 2 different computers, Iām happy.
The good thing with this setup is that since your Windows machine is the host, youāre not going to get any added latency whatsoever. At worst, your Mac may get some when using your shared keyboard and mouse, but since itās used purely for work, it shouldnāt make any visible difference.
Setup
Head to the Barrier installation page and install the software on both your Windows and Mac machine
Setup your Windows machine to be the server and your Mac machine to be the client
On Windows: Write down the IP address indicated next to IP addresses.
On Mac: Set the client to connect to the IP address indicated above. Write down the Screen name indicated.
On Windows: Go to āConfigure Serverā and add a new monitor next to your main one (should be in the center). Double-click on it and enter the Screen name indicated on Mac. That tells the server to allow that specific client and place it wherever you placed it in relation to your main monitor. For example, if you place the Mac client to the left of your Windows one, moving the mouse to the left edge of your Windows screen will transfer mouse and keyboard to the Mac and vice-versa.
You should now be able to connect both machines. Start the server and try connecting from the client.
Depending on where you placed the Mac client, moving your mouse to that edge of the screen should move your mouse to the Mac client.
Caveats
Unfortunately, not everything is 100% perfect. For Barrier to work, you need two things:
- You need the server (Windows) to be running/not sleeping
- You need the client (Mac) to be running/not sleeping
One thing that you could do is have your Mac wake up/sleep on a set schedule. For example, you could have it wake up every day 15 minutes before you start work, that way itās always ready to receive inputs.
š„ļø Monitor through dual input + ControlMyMonitor
First things first, what we want to do is plug in our monitor to both our Windows machine and our Mac machine. Depending on your setup, that might involve some HDMI to USB-C converter or some other nonsense that Apple kind of forces us to do. Thanks, Apple.
Once you have your monitor plugged into both your machines, you could quite simply just use your monitor buttons/UI to switch the input, but Iāve always found those settings to not only 1) be confusing 2) take forever. And if youāre going to be switching back and forth between the two machines multiple times a day like I am, youāre going to want a better solution.
Luckily, you can actually control your monitorās input through software! Thatās something that I discovered quite recently and thatās pretty amazing. This little piece of software called ControlMyMonitor does just that and it has a nifty little UI + it responds to parameters, which is very convenient as weāll see later.
Setup
Download ControlMyMonitor. We donāt even need to install anything! My favorite kind of software.
Start it and it will try to read all the different settings that it can send to your monitor. The one weāre interested in is Input Select (In my case, thatās 60):
Double-click on it and try changing it for one of the values that you see listed on the right.
Keep changing it until you land on your Mac. Write it down.
Amazing. Now we know we can change our monitor input purely through software. The next thing we should do is write a little script that will do that just for us, that way we just have to run the script and itāll allow us to toggle between the two inputs without needing to lift a finger š
Create a new .bat
file somewhere thatās easily accessible and enter the following script:
"{CONTROL_MY_MONITOR_PATH}" /SetValue "{MONITOR_NAME}" {INPUT_SELECT_ID} {MAC_MONITOR_VALUE}
Here are the values you should replace:
CONTROL_MY_MONITOR_PATH: Path of the executable for ControlMyMonitor.exe. It could be something like āC:\Users\MyUser\Downloads\ControlMyMonitor.exeā. Donāt forget the āā around the whole path.
MONITOR_NAME: This is the name of the monitor you see at the very top of the ControlMyMonitor window. Donāt forget the āā around the name.
(In my case, thatās ā\\.\DISPLAY1\Monitor0ā)
INPUT_SELECT_ID: Thatās the ID you see on the very left of the ControlMyMonitor window for the Input Select row. In my case, that was 60 (see screenshot above)
MAC_MONITOR_VALUE: Thatās the value you wrote down a couple of steps above when you were looking for the right setting to change it to.
Hereās what mine looks like for example:
"D:\Tools\ControlMyMonitor.exe" /SetValue "\\.\DISPLAY1\Monitor0" 60 17
Save the file and try running it. If you did everything right, your input should have switched to the Mac! You can now create a similar file to switch to Windows and use a tool to be able to run scripts from keyboard shortcuts :)
Bonus - Use a Stream Deck for easier control
One of my favorite productivity tools is an Elgato Stream Deck. As the name implies, it was originally built with streamers in mind and allows for easy switching between OBS scenes and other streaming-related tools. Itās also extremely customizable, and it can help us with our little scenario š
The plugin called Advanced Launcher by BarRaider allows us to run executables with support for arguments just by pressing a button on our Stream Deck. See where Iām going with this?
The way I have mine set up is as follows:
As you can see, weāre basically doing the same thing we were doing with the script earlier, except weāre specifying where to find the ControlMyMonitor.exe executable and then passing the arguments to tell it what to switch to.
That pretty much covers it! At this point, you should be able to seamlessly switch your mouse and keyboard from one computer to the next and have an easy way to switch inputs on your monitor without pressing a bunch of buttons on your monitor.
Subscribe to my newsletter
Read articles from Mathieu Bruguier directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by