Ensure display preferences remain active after reboot.
Ensure display preferences remain active after reboot.
I secured a long HDMI cable so my computer could connect to the TV. Now I need the TV to replicate my main screen while an extra monitor is added. It’s been straightforward to craft the command (xrandr --output DVI-D-0 --output DP-1 --output HDMI-0 --same-as DP-1) to achieve that setup. Using NVIDIA X Server it’s even simpler. The issue is that disconnecting the cable or cable removal resets everything, forcing me to reconfigure. Is there a way for Ubuntu to handle this automatically when HDMI-0 is connected?
A simple approach would be to use cron to regularly verify the device you need, and execute the command when it appears. You should expect roughly a one-second pause between connecting the display and it functioning properly. If you're interested in this method, explore cron and the lsusb utility from usbutils. I'll look for a more effective solution and return with an updated plan, but if it doesn't work, this should suffice.