SOLUTION FOR KSCREEN NOT SAVING DUAL MONITOR CONFIGURATION IN OPENSUSE 13.1

PROBLEM

If you are running a dual monitor screen configuration in openSUSE 13.1 you might be having problems with Kscreen saving your configuration. If you logout or reboot, your dual monitor configuration will be lost. This problem persists even if you install proprietary drivers from Nvidia and attempt saving your configuration trough nvidia-settings**.

SOLUTION**

  1. Download and install ***arandr ***and make sure that xrandr is also installed along with its libraries (it should already be.)

  2. Open terminal and run arandr as user, not as su. It will open a configuration screen similar to the one used by Kscreen. Place your monitors as per your needs and save the configuration. Name it aranadr.conf. The program will save the configuration file in a shell script in a hidden folder in /home/username/.screenlayout/arandr.conf.sh.

  3. Open Configure Desktop > Startup and Shutdown > Autostart > Add Script Provide the complete path for your arandr.conf.sh script, i.e.

/home/username/.screenlayout/arandr.conf.sh

and make sure to enable it at Startup. Apply this change.

That’s it. Now when you logout or reboot, your KDE will open momentarily with the old screwed up configuration, but almost immediately after that the script will correct it to the way you want.

Enjoy!

Well, you could also just disable the “KScreen 2” service in “Configure Desktop”->“Startup and Shutdown”->“Service Management”.
Then Kscreen’s saved configuration should not be restored on login.

Thanks, wolfi. That was the finishing touch needed to completely substitute a flaky Kscreen. Man, you DO know your openSUSE !!!

I never had this problem with 10.x, 11.x, and 12.x iterations of openSUSE that used sax2, xorg.conf, and then *krandr. *But ever since I installed openSUSE 13.1 a day or two after it was released, I have been grappling with this very vexing problem with Kscreen and my dual monitors since 13.1 no longer uses any of the old, proven screen utilities. And the proprietary driver settings managers offer no relief either, as you might attempt saving your configuration even as su, to the same ineffectual results.

And it is not an openSUSE problem only. I found the same sad situation in Fedora 20 KDE and Kubuntu 13,10, and even in 14.04 RC1 with the new 3.12 kernel. It is a shame that the nice folks at KDE have dropped the ball with Kscreen/dual monitors and, apparently, without having done anything yet to solve it. And it is a problem that, judging by the myriad complaints all over the internet, affects a whole LOT of people.

The arandr solution I offered here (and completed with your very accurate finishing detail) is, I think, the easiest one to implement and the one involving no undesired package regressions (like you would have if you attempted to bring back and use the old krandr), and absolutely no risk, AFAIK, to your installation.

Feel free to post a bug report concerning issues with KScreen. It’s the only way it will get fixed.

https://bugs.kde.org/show_bug.cgi?id=325277

http://community.kde.org/Solid/Projects/ScreenManagement#How_to_report_a_bug

This problem-- essentially that Kscreen does not save multidisplay configurations through logouts/reboots in many systems --has been widely reported to KDE already. But as far as I can tell after poring for hours the related KDE forums seeking a solution (and finding none there, I might add), the KDE team responsible for Kscreen has not implemented a cure yet. IMHO Kscreen was supposed to have been a be-it-all, do-it-all screen master able to leap over and supersede all previous (and fully functional) screen utilities. All it has ended being, though, is a horrible, regressive aggravation. A very compelling argument as to why developers should not mess around with things that already work just fine…

Add my name to the list of grumbling users. I had a perfectly working krandrrc for my triple monitor setup that included a startup command to add a screen mode that’s improperly detected through a DisplayPort to DVI adapter. Worked fine in previous openSUSE versions.

Then they go and remove the functionality and replace it with something that isn’t even finished? C’mon, how did the Kscreen module even make it past alpha test when that basic function is so broken?

Found this thread yesterday and it got me 80% of the way there.
Every since upgrading to 13.1 my dual monitors insist in starting up in, basically clone mode (same desktop duplicated on both screens).

I’m able to bring up the desktop settings, configure them side by side, with the leftside active, with no problem but, as has been mentioned above it does not seem to save that configuration anywhere.

I created an arandr.config.sh, set it up in the startup folder, and unchecked kscreen in the “Service Management”.
Now when I logout/login it does configure my monitors correctly but, not before restoring most of my saved session, much of which consists of windows on the second monitor, meaning I have to go through each desktop dragging the windows to their proper location.

Can anyone suggest a way to move the “arandr.config” earlier in the X startup, so that the desktop is configured before the session is restored?

Thank you

You could configure this in /etc/X11/xorg.conf or /etc/X11/xorg.conf.d/. Then it would be system-wide for the whole X and therefore applied before your KDE session is started.
But I can’t tell you how to do this exactly. (I only have single monitor setups)

If you’re using nvidia, you might be able to use “nvidia-settings” for creating this config file.

Or maybe run that arandr.config script in /etc/X11/xinit/xinitrc or similar. (maybe just put it to /etc/X11/xinit/xinitrc.d/, it should then be called automatically when the X session is started, before KDE runs)

It turns out that a closer look at the options in the “Autostart->System Settings->Script file->Run On” drop down provided the answer.

I had set it to “Startup”, setting it to “Pre-KDE startup”, runs the script and configures the desktop prior to my session being restored.

Hope this helps someone else. :slight_smile:

Great find, thanks Larry!

Anyone have a solution for this if not running KDE?

I use xfce or mate usually and this is driving me crazy.

Well, I don’t know much about xfce or mate, but you can of course create a similar script and put it somewhere so it’s run on login. (but I don’t know whether they have a similar place for scripts like KDE)

One possibility would be to create a .desktop file in ~/.config/autostart/ that runs the script.
See also here: how do I run an arbitrary shell script on startup? / Desktop / Xfce Forums
This should actually work with all Desktops, even KDE.

Hey Folks :slight_smile:

My Solution:

Source:

GENERAL:

http://en.opensuse.org/SDB:Configuring_graphics_cards
https://wiki.archlinux.org/index.php/Multihead
http://www.maketecheasier.com/how-to-setup-dual-monitors-with-xrandr/
https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_T420s#Example_X.org-Configuration_using_Intel_and_NVIDIA_together
http://www.linuxfromscratch.org/blfs/view/svn/x/xorg-config.html
http://wiki.gentoo.org/wiki/Xorg.conf

NVIDIA:

ftp://download.nvidia.com/XFree86/Linux-x86/304.32/README/configtwinview.html
https://wiki.gentoo.org/wiki/Xorg/Configuration
ftp://download.nvidia.com/XFree86/Linux-x86/173.14.35/README/appendix-b.html
https://forums.geforce.com/default/topic/369385/geforce-drivers/failed-to-initialize-the-glx-module-can-39-t-init-glx-driver-on-fedoracore-6/

Multimonitor:

https://help.ubuntu.com/community/XineramaHowTo
http://www.x.org/archive/X11R6.8.2/doc/DESIGN2.html
http://forums.fedoraforum.org/showthread.php?t=207081
ftp://download.nvidia.com/XFree86/Linux-x86/1.0-8756/README/appendix-p.html
http://forum.manjaro.org/index.php?topic=4489.0
http://wiki.manjaro.org/index.php?title=Configure_NVIDIA_%28non-free%29_settings_and_load_them_on_Startup

http://forums.gentoo.org/viewtopic-t-964098-start-0.html

EDID:

https://bbs.archlinux.org/viewtopic.php?id=101547
www.cyberwizzard.nl/site/blog-linux-gentoo-linux/147-debugging-nvidia-edid-resolutions.html
http://sathyasays.com/2008/10/26/how-to-tackle-screen-resolution-problems-in-linux/

xrandr

Output:

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 8192 x 8192
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
DVI-I-2 disconnected (normal left inverted right x axis y axis)
DVI-I-3 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
   1920x1080      60.0*+   59.9     50.0     60.1     60.0     50.0  
   1680x1050      60.0  
   1600x1200      60.0  
   1440x900       75.0     59.9  
   1280x1024      75.0     60.0  
   1280x960       60.0  
   1280x800       59.8  
   1280x720       60.0     59.9     50.0  
   1152x864       75.0  
   1024x768       75.0     70.1     60.0  
   800x600        75.0     72.2     60.3     56.2  
   720x576        50.0  
   720x480        59.9  
   640x480        75.0     72.8     59.9

zypper install VirtualGL primus

/sbin/lspci -nnk | grep VGA -A2

Output:

##-----

01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GT200b [GeForce GTX 285] [10de:05e3] (rev a1)
        Subsystem: ASUSTeK Computer Inc. Device [1043:8320]                                                                                                                           
        Kernel driver in use: nvidia                                                                                                                                                  
--
07:00.0 VGA compatible controller [0300]: NVIDIA Corporation GT200b [GeForce GTX 285] [10de:05e3] (rev a1)
        Subsystem: ASUSTeK Computer Inc. Device [1043:8320]
        Kernel driver in use: nvidia
08:00.0 VGA compatible controller [0300]: NVIDIA Corporation G92 [GeForce 9800 GTX] [10de:0612] (rev a2)
        Subsystem: ZOTAC International (MCO) Ltd. Device [19da:1056]
        Kernel driver in use: nvidia

##-----

#Run Nvidia

nvidia-xconfig as Root -> Generate /etc/X11/xorg.conf
nvidia-settings as Root -> Gernerate /etc/X11/xorg.conf (maybe merge?)

#in terminal as root
#Copy original

#copy section “ServerLayout” to 20-serverlayout.conf
cd /etc/X11/xorg.conf.d/
kwrite 20-serverlayout.conf
#1. TwinView Option

TwinVIew

##---------------------------------------------------------------------------------------------

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Screen      1  "Screen1" RightOf "Screen0"
#    InputDevice    "Keyboard0" "CoreKeyboard"
#    InputDevice    "Mouse0" "CorePointer"
    Option         "MultiGPU"           "Auto"
    Option         "SLI"                "Auto"
#    Option         "Xinerama" "1"              #not 3D-Accelerrated
    Option         "TwinView" "1"              #3D-Accelerrated
#    Option         "DynamicTwinView" "1"
#    Option "AcpidSocketPath" "string"
#    Option "ConnectToAcpid" "boolean"
EndSection

##---------------------------------------------------------------------------------------------
2. Mosic Option

Mosaic

##---------------------------------------------------------------------------------------------

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

##---------------------------------------------------------------------------------------------

kwrite 30-files.conf
##---------------------------------------------------------------------------------------------

Section "Files"
        ModulePath   "/usr/lib64/nvidia/xorg/modules/extensions/"
        ModulePath   "/usr/lib64/nvidia/"
        ModulePath   "/usr/lib64/xorg/modules/updates/extensions/"
        ModulePath   "/usr/lib64/xorg/modules/extensions"
        ModulePath   "/usr/lib64/xorg/modules"
EndSection

##---------------------------------------------------------------------------------------------

kwrite 31-modules.conf
##---------------------------------------------------------------------------------------------

Section "Module"
        Load  "record"
#        Load  "xtrap"
        Load  "type1"
        Load  "freetype"
        Load  "GLcore" 
        Load  "glx"
        Load  "dbe"
        Load  "extmod"
EndSection

##---------------------------------------------------------------------------------------------

write 32-serverflags.conf
##---------------------------------------------------------------------------------------------

Section "ServerFlags"
        Option      "AIGLX" "on"
EndSection

##---------------------------------------------------------------------------------------------

cp /etc/X11/xorg.conf.d/50-device.conf /etc/X11/xorg.conf.d/50-device.conf.Before-Nvidia-Xorg
kwrite 50-device.conf
##---------------------------------------------------------------------------------------------

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 285"
    BusID          "PCI:1:0:0"
    Option         "RenderAccel"   "true"
    Option         "AddARGBGLXVisuals"  "true"
#    Option         "UseEDIDDpi"         "false"
    Option          "UseEdidFreqs"  "true"
    Option         "DPI"                "96 x 96"
    Option         "Coolbits"           "1"    
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 285"
    BusID          "PCI:7:0:0"
    Option         "RenderAccel"   "true"
    Option         "AddARGBGLXVisuals"  "true"
#    Option         "UseEDIDDpi"         "false"
    Option          "UseEdidFreqs"  "true"
    Option         "DPI"                "96 x 96"
    Option         "Coolbits"           "1"
EndSection

##---------------------------------------------------------------------------------------------

cp /etc/X11/xorg.conf.d/50-monitor.conf /etc/X11/xorg.conf.d/50-monitor.conf.Before-Nvidia-Xorg
kwrite 50-monitor.conf
##---------------------------------------------------------------------------------------------

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Samsung SMBX2231"
    HorizSync       26.0 - 81.0
    VertRefresh     48.0 - 75.0
    Option         "DPMS"
#    Option         "ModeDebug" "TRUE"
#    Option         "ModeValidation" "NoDFPNativeResolutionCheck” 
EndSection

Section "Monitor"
    # HorizSync source: unknown, VertRefresh source: unknown
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "Samsung SMBX2231"
    HorizSync       26.0 - 81.0
    VertRefresh     48.0 - 75.0
    Option         "DPMS"
#    Option         "ModeDebug" "TRUE"
#    Option         "ModeValidation" "NoDFPNativeResolutionCheck” 
EndSection

##---------------------------------------------------------------------------------------------

cp /etc/X11/xorg.conf.d/50-screen.conf /etc/X11/xorg.conf.d/50-screen.conf.Before-Nvidia-Xorg
kwrite 50-screen.conf

1. TwinView Option

TwinView

##---------------------------------------------------------------------------------------------

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "metamodes" "nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "metamodes" "nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

##---------------------------------------------------------------------------------------------

2. Mosic Option

Mosaic

##---------------------------------------------------------------------------------------------

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-1"
    Option         "metamodes" "GPU-941b4bb4-0600-872c-f01e-f0650d7fdd91.DVI-I-3: nvidia-auto-select +0+0, GPU-225e1dbd-15d3-7bff-ad7c-943c117a118b.DVI-I-3: nvidia-auto-select +1920+0"
    Option         "MultiGPU" "On"
    Option         "SLI" "On"
    Option         "BaseMosaic" "on"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

##---------------------------------------------------------------------------------------------

#copy section “Extensions” to 60-extensions.conf
kwrite 60-extensions.conf

1. Composite disabled

##---------------------------------------------------------------------------------------------

Section "Extensions"
    Option         "Composite" "Disable"
EndSection

##---------------------------------------------------------------------------------------------

2. Composite enabled

maybe that you better activate CompositeExtensions

Section "Extensions"
    Option         "Composite" "Enable"
EndSection

#add multiple lines 50-device.conf
kwrite 50-device.conf
##---------------------------------------------------------------------------------------------

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 285"
    BusID          "PCI:1:0:0"
    Option         "RenderAccel"   "true"
    Option         "AddARGBGLXVisuals"  "true"
#    Option         "UseEDIDDpi"         "false"
    Option         "UseEdidFreqs"  "true"
    Option         "DPI"                "96 x 96"
    Option         "Coolbits"           "1"    
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 285"
    BusID          "PCI:7:0:0"
    Option         "RenderAccel"   "true"
    Option         "AddARGBGLXVisuals"  "true"
#    Option         "UseEDIDDpi"         "false"
    Option          "UseEdidFreqs"  "true"
    Option         "DPI"                "96 x 96"
    Option         "Coolbits"           "1"
EndSection

##---------------------------------------------------------------------------------------------

#add users to group “video” und “bumblebee”

usermod -a -G video $USER # $USER = all users, who work with the graphical interface
usermod -a -G bumblebee $USER

rename or delete xorg.conf

rm -r /etc/X11/xorg.conf
ll /etc/X11/

reboot

xrandr

Output:

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 8192 x 8192
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected primary (normal left inverted right x axis y axis)
DVI-I-2 disconnected (normal left inverted right x axis y axis)
DVI-I-3 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
   1920x1080      60.0*+   59.9     50.0     60.1     60.0     50.0  
   1680x1050      60.0  
   1600x1200      60.0  
   1440x900       75.0     59.9  
   1280x1024      75.0     60.0  
   1280x960       60.0  
   1280x800       59.8  
   1280x720       60.0     59.9     50.0  
   1152x864       75.0  
   1024x768       75.0     70.1     60.0  
   800x600        75.0     72.2     60.3     56.2  
   720x576        50.0  
   720x480        59.9  
   640x480        75.0     72.8     59.9

#Screen 0 = DVI-I-3

For Bumblebee

!!NVIDIA GL Module have to be same Version as Drivers!!

glxinfo | egrep “(OpenGL vendor|OpenGL renderer|OpenGL version)”
#Output:

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 285/PCIe/SSE2
OpenGL version string: 3.3.0 NVIDIA 319.32

???
Are you sure you posted this in the right thread?
This was about dual monitor configuration, not dual graphics cards (or nvidia optimus/Bumblebee)…

Also I think most of the stuff you suggest is not even necessary.

I know this is an old thread.

I have been searching for a solution to a problem that dual screen setting got lost after logout and login.

I have tried a few solutions from this thread, some worked a while but stopped working.

This is my solution which works like a charm now.

put following into~/ .profile:
xrandr --output LVDS --auto --pos 0x0 --output VGA-0 --auto --pos -1920x0

That was annoying, that the provided tool for screen setting is useless for my configuration, 6 screens in a 2x3 set up.

So ARANDR installed


sudo zypper install arandr


then open ARANDR position your screen, save .sh file

open in kwrite: /home/USER/.screenlayout/ARANDR_SAVED_FILE.sh
copy everything after and including xrandr

e.g. to be copied text in italics:


#!/bin/sh
*xrandr --output DisplayPort-1 --mode 1920x1080 --pos 1920x1080 --rotate normal --output DisplayPort-0 --mode 1920x1080 --pos 0x1080 --rotate normal --output DisplayPort-3 --mode 1920x1080 --pos 1920x0 --rotate normal --output DisplayPort-2 --mode 1920x1080 --pos 0x0 --rotate normal --output DVI-1 --mode 1920x1080 --pos 3840x1080 --rotate normal --output DVI-0 --mode 1920x1080 --pos 3840x0 --rotate ***normal**

then
open in kwrite: /home/USER/.config/autostart/lxrandr-autostart.desktop

mark everything from the 'xrandr till the ending ’ excluding both ’ ’

e.g.:


[Desktop Entry]
Type=Application
Name=LXRandR automatisch starten
Comment=Xrandr mit den Einstellungen aus LXRandR starten
Exec=sh -c '*xrandr --output DisplayPort-1 --mode 1920x1080 --pos 1920x1080 --rotate normal --output DisplayPort-0 --mode 1920x1080 --pos 0x1080 --rotate normal --output DisplayPort-3 --mode 1920x1080 --pos 1920x0 --rotate normal --output DisplayPort-2 --mode 1920x1080 --pos 0x0 --rotate normal --output DVI-1 --mode 1920x1080 --pos 3840x1080 --rotate normal --output DVI-0 --mode 1920x1080 --pos 3840x0 --rotate normal*'
OnlyShowIn=LXDE

paste the line from kwrite: /home/USER/.screenlayout/ARANDR_SAVED_FILE.sh here and replace it. Save the file, done.
LXDE will now start with your saved configuration.