I've tried numerous methods of getting the following commands to run at startup

xrandr --output DFP10 --rotate left
xrandr --output DFP11 --right-of DFP10

This is necessary because my left monitor is portrait. When I launch Ubuntu Gnome 14.04.2,it sets DFP10 (the portait monitor which is on the left) to be on the right, and does not rotate it to portait).

I have tried putting a script in /etc/rc.local & usr/share/applications, adding the command to startup applications in the form: xrandr --output DFP10 --rotate left && xrandr --output DFP11 --right-of DFP10.

None of these work. Yet, I know that the commands work, if I run them myself in terminal.

Here's some background the situation, that i think might be relevant:

I'm definitely not an expert on this. I know that there a bunch of different config files for editing display options. xorg.conf, xorg.conf~ (a backup), xorg.conf.fglrx-0 and xorg.conf.fglxr-0~ (backup) all exist within /etc/X11 but editing them does not solve my problem.

The situation involving the display driver is fairly complex. I'm running the latest fglrx-updates on my AMD R9 280X, which took some work... I have used a workaround for installing the driver on 14.04.2 (necessary due to bug with LTS Enablement Stacks)

TLDR; how do I make this: xrandr --output DFP10 --rotate left and this xrandr --output DFP11 --right-of DFP10 run at startup?

thanks in advance

  • I forgot to add: monitors.xml has also been edited. Perhaps all these config files are conflicting? – Joe Thorpe Apr 15 '15 at 7:16

What you usually need to do in these situations is adding a small break in the command after login. Add this to your Startup Applications:

/bin/bash -c "sleep 15&&xrandr --output DFP10 --rotate left && xrandr --output DFP11 --right-of DFP10" 

(If that is the normally working command)

The reason is that most likely the command is performed too early, while the desktop is still loading. It will break then.

You can experiment a little with the sleep 15 duration to see what is needed or possible.

  • Hi. as much as that should work, it hasn't. i understand why you did the sleep 15, but i'm not sure what the /bin/bash -c does – Joe Thorpe Apr 15 '15 at 9:26
  • @JoeThorpe Try increasing the time, it really should work if the command: xrandr --output DFP10 --rotate left && xrandr --output DFP11 --right-of DFP10 is working from the terminal after login. The /bin/bash is to make it work in the created .desktop file. Startup Applications creates a .desktop file in ~/.config/autostart. The mixed command makes the /bin/bash necessary in shell commands, run from a .desktop file. – Jacob Vlijm Apr 15 '15 at 9:32
  • @JoeThorpe could you post the output of xrandr somewhere? Likely it takes some time for the system to recognize the second screen. In that case a script to "wait" for the screen before taking action would synchronize the process. Else please set the sleep 15 to (e.g.) sleep 100, decreasing until you got the right waiting time. Really, I am pretty sure. – Jacob Vlijm Apr 15 '15 at 12:34
  • Hi, apologies for not getting back to you sooner. I tried sleep 40, but i will try sleep 100. Where do i find the output of xrandr? i googled it, but understandably, the results were talking about display outputs.. – Joe Thorpe Apr 15 '15 at 23:06
  • 1
    Oh yes, sorry i forgot about that. Thanks for your help, and your answer is marked as so! – Joe Thorpe Apr 16 '15 at 8:05

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.