![]() Registered Member ![]()
|
I know I can disable KScreen now:
But KScreen messed up my multi-monitor display within minutes of setting up it, so it wasn't getting off so lightly ![]() I created a script in my home directory:
And a file in /etc/udev/rules.d/99-monitor-change.rules
But then came the arduous journey of really getting it to work. First, to allow root to access my session I created this function:
Together with:
Now I could do certain things such as:
In this case I have my main monitor at 1440x900 and my TV is 1080p but also has a mode 1360x768 which is much close and I zoom in a bit and I end up at 1442x900 which looks okay (the 1442x900 image is shrunk to 1360x768 which is why I call it zooming in) --- but this looks a bit better than 1440x900. I have a problem with aspect ratios anyway (1440x900 = 1.6:1, 1920x1080 = 1.78:1, 1360x768 = 1.77:1). But I want it to fix itself according to the setup of my monitors. When the TV is turned off but HDMI is still connected to the receiver the 1360x768 mode disappears from it:
And with the TV on, it is still there:
Actually I faked the above. More disappears from the HDMI-1 line when the TV is off:
Even though it is still set to connected (audio will still work). So I test for this line to know which is which:
As well as to know about HDMI in the first place, and I get these three options:
Which turns into these three sets of configurations:
However if I turn my TV back on the problem is that KScreen fires after my own script and it will set about setting everything "in order" once more. At first I thought it would always call "setConfig" but it turns out it only does that if it starts messing with me. There is not really a good way to know when it is done configurating. In the end I created a hugely complex function to wait for a certain line in the log file:
But it turned out waiting for "XRandR::setConfig done!" didn't make sense and "Emitting configChanged()" can basically appear anywhere. Maybe I will just wait until KScreen stops outputting data for 2 seconds ![]() This was my original wait function:
But the effect is already that it can't find anything and just times out after a second of no new logs, and it works ![]() The reason I bork the display first is because xrandr sometimes won't work if the existing values are too close to the new value you won't. I guess it would be better to create a flag for that because this causes the display to flicker twice. The new script has a --bork option for when you use it manually. Here it is if you want it: http://www.xen.dds.nl/f/scripts/fixscreen It contains a lot of logging code. It is executed in the background so as to not hold up udev. It logs 2 entries to syslog under the name of KScreen-fighter ![]() ![]() |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]