10

To fight with dual-monitor resolution problems, I followed the advice found in other questions here related to session- and display-setup-script. I have the following /etc/lightdm/lightdm.conf:

[SeatDefaults]
user-session=ubuntu
greeter-session=unity-greeter
allow-guest=false
display-setup-script=/usr/bin/dualmon.sh
session-setup-script=/usr/bin/dualmon.sh

I also have the following (executable) /usr/bin/dualmon.sh that I created:

#!/bin/bash

xrandr --output LVDS1 --auto --left-of HDMI1 --output HDMI1 --auto
# notify-send Dualscreen activated

touch /home/shade/Desktop/touched

However, the resolution is wrong both at the login screen and after I log in. Also, the file /home/shade/Desktop/touched is not there. When I run the dualmon.sh script manually (after I log in), the resolution is set correctly.

This makes me think that the scripts are not run at all. What is the cause of this and how can I fix it?

Shade
  • 259
  • 1
  • 2
  • 14
  • 1
    I'm seeing the exact same problem. Attempting to setup i3 on Ubuntu 12.04.3, nearly fresh install. If you found a solution, please answer your own question. :) – dfarrell07 Sep 11 '13 at 19:05
  • I did find a sort of solution, where the script would only run if the display-setup-script config directive wasn't set, or something. However, I have since migrated to 13.04, where I don't seem to have this problem. Or, I did have it, but can't find anything related to it on my current install. Sorry. – Shade Sep 12 '13 at 07:51
  • Okay, thanks for the info. Until I figure something else out, I'm just running an xrandr script after login to fix my display. – dfarrell07 Sep 13 '13 at 18:27
  • can you try to disable the two scripts, and put it only in greeter-setup-script? also, please check your bash script is really executable :) – Starry Mar 03 '14 at 08:49
  • @Starry, the issue no longer manifests itself on a vanilla 13.10 installation, so the question is mostly defunct. Thanks for the suggestion, though. – Shade Mar 03 '14 at 10:10

1 Answers1

1

Using Ubuntu, the best way to get your user account to have the right resolution for your dual monitor setup is as follows:

  • Delete monitors.xml from ~/.config/
  • Open Screen Display in System Settings
  • Set appropriate screen settings (use XRandR or ARandR beforehand if need be)
  • Then the big one - Hit Apply

You'll notice after doing the above that monitors.xml is rewritten, and whenever you login your dual monitor setup will work.

Secondly, to get the login screen to work correctly the process you need to follow is as is this answer. The tricky part is ensuring your permissions are correct - On top of setting the correct permissions for the symbolic link, you also need to make sure Others are able to access the monitors.xml file as well as the ~/.config folder.

The beauty of this setup is, as opposed to trying to brute force some xrandr commands, that whenever you change your resolution/monitor set-up in Ubuntu, your login screen will follow suit.

For both of the above to work you need to make sure you remove any references to xrandr commands at startup.

  • I cannot get this working. Copying monitors.xml does not change anything. Do you have any hint for me how to debug that? Permissions are set (user can read, all files and folders owned by user lightdm), I don't know anything about references to xrandr, lightdm log files do not give any hints, ... Thank you! – lumbric Nov 15 '15 at 13:55
  • User lightdm also needs access to the file (and symbolic link, if you go that route). That was the one that tricked me up for a while – Andrew Hargrave Nov 16 '15 at 23:10