2

I am trying for some time to get xrandr commands to work at startup. For example when I try to run this command

xrandr --output HDMI2 --set "Broadcast RGB" "Full"

at startup from ~/.profile the command will actually work but I will always be presented with an error message like this one:

Error found when loading /home/usr/.profile

xrandr: Output DP1 is not disconnected but has no modes
xrandr: Output DP1 is not disconnected but has no modes
xrandr: Output HDMI1 is not disconnected but has no modes
xrandr: Output DP1 is not disconnected but has no modes
xrandr: Output DP1 is not disconnected but has no modes
xrandr: Output HDMI1 is not disconnected but has no modes

As a result the session will not be configured correctly. 
You should fix this problem as soon as feasible.

I have to click "OK" to continue the startup process. From there on everything works as expected and the actual command for HDMI2 is successfully passed.

I had similar problems with other xrandr commands (change of resolution or refresh rate) before and was unable to resolve them. There is only one monitor connected to the machine (HDMI2).

Ubuntu 16.04 on Intel NUC5PPYH

Let me know if I need to provide anymore information.

Thank you for your help!

  • 2
    Have you tried running the command as a script from Startup Applications, as described in this linked question: How to run xrandr commands at startup in Ubuntu? It's probably a more appropriate place than your .profile file. – steeldriver Oct 09 '16 at 12:28
  • Yes, I did! When I tried the 2nd Option as layed out by @Jacob Vlijm like this: /bin/bash -c "sleep 15&&xrandr --output HDMI2 --set "Broadcast RGB" "Full"" I didn't get an error message but the when checked back via terminal with xrandr --verbose the color space was still unchanged at automatic. I also tried to raise the sleep value up to 100 without success. – CmdAltEsc Oct 09 '16 at 13:45
  • 2
    You need to be careful with quoting in situations like this - try replacing the outer double quotes with single quotes i.e. /bin/bash -c 'sleep 15 && xrandr --output HDMI2 --set "Broadcast RGB" "Full"' – steeldriver Oct 09 '16 at 17:31
  • 1
    That was it! I replaced the double quotes and the set the sleep value to 20. Now the switch happens successfully during the startup process without any error messages. Thank you very much. – CmdAltEsc Oct 09 '16 at 21:24

0 Answers0