I have an office. It's like a home office but it's in another place. It's just mine, so I get the peace and quiet of a home office but also get to go outside to get there. It's a good setup.
BUT I have two computers there. Well, actually I have like 10, but I interact with two. One is my personal desktop computer, the other is my work laptop. and I want to
use the same peripherals in the same way with both of them. That's why I have the world's most complicated schizo desktop setup.
This series of posts will document it, the why and how of it, and the various things I've learned along the way, along with making you want to buy weird chinese gadgets.
Today: Monitors
I have at least three monitors for my two computers. It
can get more complicated than that, but let's just limit
this to the "basics".
Because one of the computers (my work one) is a notebook,
it has its own monitor. Then I have two regular monitors,
both 1080p, one of them landscape and the other portrait.
This is how that looks.
![The three monitors described above](images/monitors.thumbnail.jpg)
This would normally be just a matter of plugging them in
the right computer, but ... in my case there is no right
computer!
When I am working, I want the middle monitor to be connected
to my work laptop, and when I am not, I want it connected to my desktop.
The rightmost monitor I always want for my desktop (usually playing music or videos while I work) and of course the
laptop keeps control of its own screen.
Additionally I want to be able to sporadically connect
random computers (like raspberry pis) and have them
show up on a monitor.
Now it's not so obvious, right?
Enter The HDMI Matrix
![](images/hdmi-matrix.thumbnail.jpg)
This is a 4x2 HDMI matrix. It has 4 inputs and 2 outputs.
That means it can get 4 different video signals and will
route them to 2 different monitors in a completely arbitrary
manner.
- Want input 1 in both outputs? Sure.
- Want input 1 in monitor 1 and input 2 in monitor 2? Sure.
- Want it the other way around? Sure.
It's totally overpowered for what I need, which could be done with a simpler 4x1 switch, but hey, it's nice.
So, I have 4 inputs connected:
- My desktop computer
- My desktop computer
- My work laptop
- A cable that I can reach under the desktop
The outputs are connected to the middle and rightmost monitors in the desk respectively.
When I work, the configuration is input 3 in the middle monitor, input 1 in the rightmost monitor.
When I am not working, it's input 2 in the middle monitor, input 1 in the rightmost monitor.
When I have a raspberry I want to look at for a moment, that's input 4 to the middle monitor.
Of course there is another problem:
The portrait monitor doesn't know it's on its side. So
everything is rotated 90 degrees when shown there.
Enter AutoRandr
AutoRandr
is one of those tools once you have it and use it you
can't live without it.
It saves the current monitor configuration and can restore
it whenever it sees the same monitors plugged into the same
outputs.
So, just make it look nicein "work mode", and configure all
the monitor rotations and so on, then autorandr --save work
.
Then, when you are not working, make it look nice again, and
autorandr --save home
.
Have to do that in both computers, of course.
From then on, whenever the switch changes things
around, autorandr automatically reconfigures
the monitors the right way on both computers.
The only problem is that to switch from home config to work I would have to do things like "click on the B
button of the matrix thing until is says "3", then click on the A button until it says "1" and it's boring.
Enter the Remote
As you can see in the previous picture, the matrix has a remote. It's a simple remote, with 8 buttons, one for each input/output combination.
I could just use the remote to switch between work and home configurations, but that's boring too.
So, I use software to drive an infrared emitter that switches things around when I click a button in the macro
keyboard or flip a switch on a webpage.
But that's for another post.