First, figure out what DP source your monitor runs on:
xrandr -q | grep DP
In my case it was DP-2 hence the command I needed to wake the screen was:
xrandr -d :0 --output DP-2 --auto
This is the only code you need, open terminal enter that command (change DP-2 to whatever is your source).
If you wanted to automate the whole thing, I have found only one reliable solution. It relies on swatch
to watch the /var/log/auth.log
for unlocked login keyring
message.
On Ubuntu 18.10 you install swatch
but the binary is actually called swatchdog and requires .swatchdogrc in your home dir.
In the .swatchdogrc you need:
watchfor /unlocked login keyring/
exec /path/to/the/shellscript/with/xrander/command
Launch gnome-session-properties
and add the following command:
swatchdog --tail-file /var/log/auth.log --daemon
This is a basic setup that should fix your screens. Good luck!
That's a shame. After a while of running this I have decided to go with DP to HDMI cables instead of DP to DP and that has sorted the issue permanently. I'm still on 19.04 and unlikely to upgrade in the next 3 months.
If you figure out a fix, for this solution it would be great if you could post a link to your gist as a comment :)