Why is my extended desktop configuration being reset after a reboot with Kubuntu 10.04?

2

0

I'm running Kubuntu 10.04 x64 on a Lenovo ThinkPad R500, with an external monitor attached.

If I configure extended desktop, everything works fine. The settings look like this:

extended desktop OK

After a reboot, these settings are reset and both screens are mirrored. The settings look like this:

extended desktop broken

I had my extended desktop working just fine under Ubuntu/GNOME, so I'm assuming there's something different about how KDE handles this config, I just can't seem to find the answer.

Does anyone know how to get my configuration to stick?

ThatGraemeGuy

Posted 2010-06-07T14:29:01.817

Reputation: 3 088

Answers

3

You can try a script using RandR, described here and here.

Example:

xrandr -q # identify the screen names: LVDS for laptop screen, VGA-0 for external monitor
xrandr --output VGA-0 --pos 1024x0 # to move the VGA screen 1024 pixels to the right.

You will also need to tweak the xorg.conf file, adding to the Screen section a Virtual definition, where the width is the maximum width of the displays added together, by the height of the biggest height.

EDIT

See thinkwiki.org for more info on xrandr.
The section "Now automate it on login" is probably the one that interests you the most.
The section "GUIs" lists GUI front-ends for xrandr.

harrymc

Posted 2010-06-07T14:29:01.817

Reputation: 306 093

I'm trying to figure out how it's done in regular Ubuntu/GNOME, because it works just fine there. I use my laptop with and without the external screen all the time, and I'd prefer something that just magically works. – ThatGraemeGuy – 2010-07-13T07:09:57.893

@Graeme Donaldson: See my edit. – harrymc – 2010-07-13T08:08:48.990

You can add your xandr configuration call to the kdm startup file. – txwikinger – 2010-07-13T16:20:40.087

@harrymc: Here you go – txwikinger – 2010-07-13T16:21:05.923

Thanks, but this isn't much better. It takes me about 30 seconds every day to get my dual screen config the way I want it. I'd rather keep doing that than spend countless hours trying to figure out convoluted instructions like that wiki page. – ThatGraemeGuy – 2010-07-15T12:47:41.587

@Graeme Donaldson: You can use one of the GUI tools to get your xrandr script right, then follow txwikinger's advice. – harrymc – 2010-07-15T14:18:21.777

OK I managed to get it working using arandr to generate the xrandr commands which I then put in a script. I symlinked the script in ~/.kde/Autostart, but this doesn't seem to be working for some reason. I'll figure it out some other time. – ThatGraemeGuy – 2010-07-19T11:22:13.897

1

I replaced my xorg.conf with xrandr in /etc/gdm/Init/Default. For KDM this change can be done in /etc/kde4/kdm/Xsetup. See the Ubuntu Wiki and also the Debian Wiki. These also provide examples on resolving the problem using xorg.conf.

I added the following code to run only on my main display . (I also have a number of vncserver configurations.)

if [ -x "/etc/gdm/Init/xrandr${DISPLAY}" ];
then
        /etc/gdm/Init/xrandr${DISPLAY}
fi

My /etc/gdm/Init/xrandr:0 configuration file is:

#!/bin/bash
xrandr --newmode 1280x1024    108.00  1280 1376 1488 1800   960  961  964 1000 +hsync +vsync
xrandr --addmode VGA-0        1280x1024
xrandr --output  VGA-0 --mode 1280x102
# EOF

You will need to set the frame buffer size with the --fb option to a size large enough for both screens. Check the end of the man page for xrandr. From your example you may be able to get away with a line like:

xrandr --fb 2560x1024 --output LVDS1-o --auto --output VGA1-0 --auto --right-of LVDS1-0

Verify with xrandr that the modes are available.

BillThor

Posted 2010-06-07T14:29:01.817

Reputation: 9 384

0

You will need to manually configure a /etc/X11/xorg.conf file. It is now being generated on the fly. Your old file may work, but you will likely need to strip out most of the non-monitor related stuff.

BillThor

Posted 2010-06-07T14:29:01.817

Reputation: 9 384

This was a fresh install, I haven't got an old file. Any pointers for what I should put in it? – ThatGraemeGuy – 2010-06-08T07:39:04.790

You will need the sections: Monitor, Screen, and ServerLayout.

Try 'Xorg -configure' and strip out the non-display components. Check the contents of /var/log/Xorg.0.log to see what is being configured. – BillThor – 2010-06-08T19:22:11.817

Will have to try that when I'm at work on Monday. Right now I'm at home and I don't have an external display. – ThatGraemeGuy – 2010-06-12T19:26:33.067

I had stop stop kdm first, else "Xorg -configure" complains that the server is already running. My xorg.conf.new file is here: http://dl.dropbox.com/u/279025/xorg.conf.new, but the screen/monitor section seems very plain.

– ThatGraemeGuy – 2010-06-29T07:40:12.957

I expect the output from configure will be fairly plain. You will likely have to read the documentation on the configuration file to add the second monitor and specify its location. – BillThor – 2010-06-29T23:53:54.253

There has to be a better way, it's not 1993 any more. – ThatGraemeGuy – 2010-07-12T11:15:55.643

I would expect the configuration deamons to detect both monitors and configure them. However, I don't think it is well tested.

I find some hardware configurations don't appear to make the monitor connection data available. I had to create a configuration for a single monitor as the video card doesn't recognize the monitor. – BillThor – 2010-07-12T16:54:41.107