Registered Member
|
Here are 5 scripts that I use for controlling my monitor outputs. I have an Acer "emachine" D725 laptop, which has an onboard Intel graphics card. My external monitor is an LG L1750SQ.
The first script, I put in my .kde4/env directory so it fires off before KDE loads. The if statement detects whether there is an external monitor plugged in. The rest sets up the appropriate video output.
The other four scripts are for changing monitor configs on the fly. If you try them, don't panic if your monitors turn off and on, with other funky behaviour in between. My guess is this is just xrandr sorting through the tangle of different resolutions. This one is for Laptop monitor only:
And this for VGA only:
This is for Left Xinerama:
and Right Xinerama:
I put all these in a folderview folder and keep that on one of my virtual desktops. The only one I have set to a hotkey is the one for Laptop monitor only, just in case there is a blackout, so I can turn my laptop monitor back on without rebooting. I have recently added to the autoconfiguration script to select a different set of desktop activities depending on which monitor I use, but that is a much more involved process, so I put it in a separate tutorial at: viewtopic.php?f=14&t=88644 Hope these help someone. |
Registered Member
|
Why isn't this a built-in feature?
|
Administrator
|
I believe this is due to the lack of a maintainer as such for the utilities which handle RandR interaction.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Administrator
|
Unfortunately there is not much you can do here, cloning is only really possible with the same resolution...
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Just wanted to say thanks for posting this information. I was having some serious issues with my laptop switching between the builtin display and dual external monitors.
It was fairly simple to add just one more xrandr command to handle the 2nd monitor. Also the display names were slightly different. I'd never had figured it out unless I had come across this post.
Thanks again for the post. Now to see if I can get the custom activities working for each situation. |
Registered Member
|
Is there a possibility to react on a configuration change while KDE is running?
I mostly keep my laptop in standby mode, so it doesn't help me if the check is only done when KDE loads. I observed:
If I understand right, KDE can detect the event. If so, it should possible to add a script as hook I guess. Any idea? |
Administrator
|
D-Bus allows you to connect to signals sent by applications. In this case you are watching communication to KNotify - which is a KDE Notification service.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Hi,
I've become interested in this topic and wrote a simple udev rule and a script to control the monitor connection status changes. It goes like this: /etc/udev/rules.d/99-monitor-hotplug.rules
/etc/udev/scripts/monitor_hotplug.sh
Remember to change the IN, EXT, USER variables and /sys path ("card0-VGA-1") in the script to suit your configuration. Add the executable flag for the script: chmod +x /etc/udev/scripts/monitor_hotplug.sh It works like this: 1) udev change ACTION in drm SUBSYSTEM is triggered when the monitor is being plugged in/out, which runs the monitor-hotplug script 2) depending on the monitor connection state the script runs xrandr command with specific parameters |
Registered Member
|
I finally made the switch from windows to mint 15 kde. So far I dont think I will ever look back.
Im running a monitor off vga and my tv off the hdmi. The tv isnt always on and I want it to automatically change settings when I power it on. Being sick of the display managment change monitor screwing up the auto detect settings everytime and not wanting to manually set them I disabled it. Then I made a simple script that I run and it changes the to my desired settings but thats tedious coming from the automation of windows. I cannot use the last script mentioned because the status of my device reads connected whether the tv is on or off. Is there some sort of different script i can run or can i change the display management monitor to run my script instead of asking me for it to try automatically? |
Administrator
|
Does the output of "xrandr" change on your system, if the TV is on or off? Presumably some change must occur for display management to have detected it.
Also, which version of KDE are you using? Newer versions are often shipped with KScreen in many distributions now, which works significantly better than the older display management (krandr) system.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
I have kde 4.10.5 so i do have kscreen. Im not exactly sure how to see the output of xrandr or where to look. I have noticed that if i run "udevadm monitor --property" in terminal and turn the tv on I get this
|
Administrator
|
"xrandr" in this case is a command which is probably part of an X11 utilities package if it is not available on your system.
Unfortunately that udev information doesn't seem to be too helpful in this case.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
There is no difference in xrandr whether the tv is off or on
|
Administrator
|
Unfortunate. As far as I can see it is not possible then to determine the difference.
One last thing you could check is the output of "xrandr --prop" - which may differ as I suspect some information won't be available if the TV is off.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: Bing [Bot], Google [Bot], kesang, Sogou [Bot], Yahoo [Bot]