Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

How to make Ubuntu display settings persistant

So I got a long HDMI cable so I can attach my computer to my tv. Now I want this tv to mirror my main display, while a third monitor is extended. The thing is it wasn't hard to figure out to write this (xrandr --output DVI-D-0 --output DP-1 --output HDMI-0 --same-as DP-1) command that configures it to what I want. and its not real hard to do it with nvidia x server either. The problem is that whenever the tv/hdmi cable is unplugged, it reverts back to exending everything and I have to redo the command. Is there a way to make ubuntu automatically do this when it detects HDMI-0 being plugged in

Link to post
Share on other sites
  • 5 weeks later...

A hacky solution would be to use cron to constantly check for the device you need and if it is found then run the command. You will then have about a maximum of 1s delay between plugging in the display and it working correctly. If you wanna follow this path look into cron and lsusb [usbutils package]. I will try to find a better solution and come back with it but if I can't this should work just fine.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now