Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I plug my laptop into a number of different monitors, all of which have aspect ratios not supported by my laptop. I want the built-in and plug-in monitors to be at their maximum respective resolutions and the corresponding aspect ratios, share the same lower left corner, and have the extra space "hanging over the edge".

I finally wrote a script that runs from /etc/kde4/kdm/Xsetup that uses xrandr this behavior. Now I'm trying to make all the application windows open by default in the rectangular region where the two screens overlap.

Does anybody have any suggestions for how to do this? So far I can think of two approaches, below, but have questions about both:

1) Setting default size and position in the Window Behavior control panel, finding what file it keeps those settings in, and having a different such file for each monitor configuration, copying it to the system-wide one when Xsetup runs. Question: where does the Window Behavior control panel keep its settings?

2) Setting some kind of global variable that will affect the starting geometry X11 assigns to programs when they launch. Questions: Is there a variable or file that X11 checks every time a program launches, or does the variable need to be passed to X11 from the command-line when launching the program? If so, what is the syntax? Where is a good place to set such a variable so that everything running in the X11/KDE session can see it? Can this variable be altered after KDE has already started?

System: Linux 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:07:13 UTC 2011 x86_64 GNU/Linux KDE 4.4.5 Kubuntu, Lucid Lynx

share|improve this question
add comment

1 Answer

Solution #1 looks good. KWin keeps its rules in ~/.kde4/share/config/kwinrulesrc. You can generate such rules using built-in KWin manager (kcmshell4 kwinrules).

On page Window matching remember to uncheck Dock (panel) in section Window types to not change position of panel. All other fields should have default values, so all opened windows will be matched. Size and position of windows you may set on Size & Position tab.

When you choose your preferences save settings and in file ~/.kde4/share/config/kwinrulesrc will be added new entry like this (there will be also incremented count value in section General):

Description=Unnamed entry

You can make a copy of this file or just write script to modify your values when you plug in new monitor.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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