I don't have enough space to use a monitor next to the laptop in normal orientation, so I mounted the laptop on the left-hand wall (my desk is in a corner) and I'm using it in portrait mode as the secondary display.
I like having a second screen, which i why I want to keep using it, and also I can't keep the lid closed because sometimes the laptop won't wake up from sleep mode by USB mouse and keyboard input, but only when I engage the laptop's own keyboard or mouse pad.
But for times when I disconnect the laptop, naturally I need it in landscape mode.
Currently I use a Display shortcut to rotate the screen as needed (Windows 10 with Intel graphics + Nvidia card, but the ctrl+alt+arrows no longer exist in either of the control panels), but I'd like to have the process somehow automated, i.e. to have the screen switch to portrait mode when the monitor is plugged in, and to landscape mode when it is unplugged.
Does anyone know of a way to do that?
Edit: To clarify, I'd like the screen rotation to be triggered by the hdmi being plugged in / unplugged.