Resolving KDE issues with Dual Monitors

Quite a number of users are reporting issues with KDE4 forgetting monitor settings when the log out. The end result being whenever you log back in you need to sit and reconfigure KDE to make proper use of a dual-headed system rather than cloning the primary screen onto your second.

Although the issue is apparently fixed in KDE 4.6, many aren't running this version yet.

This documentation shows a workaround that can be used in order to get KDE to remember the settings.



To begin with, configure your monitors in System Settings --> Display. This will give us the settings we need.

In a Konsole;

nano ~/.kde/share/config/krandrrc

This should give you output similar to the following






Now we need to use the xrandr command to tell the system what to use. I've found the best place to add this is in the startkde script itself (as your next upgrade will be to 4.6 right?) Before we do that, we need to look at the command so that you can customise it for your system.

xrandr --output "VGA1" --pos 1280x0 --output "DVI1"  --left-of "VGA1" --noprimary

Note that in the xrandrrc my screens were called VGA1 and DVI-0, yours may be VGA-0 or something else so alter the command to suit that. You also need to consider which screen needs to display what. My DVI screen is on the left of the VGA screen, but if yours is the other way round simply change --left-of to --right-of.


If you aren't using a resolution of 1024x1280 you'll also need to adjust the pos value.

Now we need to add the command to the startkde script (remember to substitute my command for yours)

sudo nano /usr/bin/startkde
#Find the line "kchceckrunning_result=$?" and add the following just below it
xrandr --output "VGA1" --pos 1280x0 --output "DVI1"  --left-of "VGA1" --noprimary

Save the file, and you're good to go. The login screen will still appear cloned, but after that things should sort themselves out.