Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save strayobject/89b3660c2fdee764e4acba3f18ff4259 to your computer and use it in GitHub Desktop.
Save strayobject/89b3660c2fdee764e4acba3f18ff4259 to your computer and use it in GitHub Desktop.
Fix DisplayPort monitor not waking on Ubuntu 18.10

The fix

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!

@laxdragon
Copy link

This solution has stopped working in Ubuntu 19.10.

@strayobject
Copy link
Author

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment