[lug] KDE 4 question

Nathan England nathan at paysonlinux.org
Sat Dec 3 20:41:30 MST 2011


In my kde folder there is a folder called Autostart and I have a small script 
in it which scans xranr for an externally attached monitor and if it finds it 
then it connects it the I want, if not it disables the port and only loads the 
main screen on my laptop.

The file must be executable and put it in ~/.kde/Autostart/monitors

#!/bin/bash

[1]if `xrandr | grep 'VGA1 connected' 1>/dev/null 2>/dev/null`; then
[2]     xrandr --output LVDS1 --auto --primary --output VGA1 --auto --left-of 
LVDS1
[3]else
[4]     xrandr --output LVDS1 --auto --primary --output VGA1 --auto --off
[5]fi

I numbered the lines in case screen wrap gets you.

This might do the trick for you.

Nathan

On Friday, December 02, 2011 16:19:43 Davide Del Vento wrote:
> Hi,
> 
> thanks for your answers so far.
> 
> > I've seen something similar and filed
> > <https://bugs.kde.org/show_bug.cgi?id=284413>.
> 
> I have noticed this behavior. It's of course different than mine, and
> (although annoying) I'd call it less severe, since if you unplug
> "live" you can probably replug immediately. Whereas in my case if I
> leave my desk I can't use that user anymore (maybe it's an identity
> crisis? a laptop that thinks to be a desktop? :-)
> 
> > The trick to avoid it is to
> > either leave the laptop screen as the primary when configuring the
> > external monitor
> 
> This doesn't work for me, forgot to mention that it's already how I
> configured it.
> 
> > or to explicitly disable the external display before removing the laptop
> 
> This would work, but if I forget to turn off BOTH the external
> displays, before turning off the laptop, and make THAT the DEFAULT in
> KDE (it can't be scripted, AFAIK, it's 5 minutes of annoying clicks)
> then I'm screwed.
> 
> Lee wrote:
> > If you have consolekit (probable with KDE4), you might try this:
> >   sudo -u user ck-launch-session dbus-launch /path/to/thunderbird
> 
> Thanks Lee this is a nice convenience trick. For better security (eh
> is thunderbird doing something as root?? Probably no, but if there is
> a bug somewhere that allows for an exploit??): it can be done avoiding
> root privileges with:
> 
> su user -c 'ck-launch-session dbus-launch thunderbird'
> 
> Looks like for the projector, if I don't make it EVER it default, I
> should be safe.
> 
> Thanks,
> Davide
> PS: I will collect some more data and file a bug report, but it looks
> like the problem is that the "save default" option is implemented too
> aggressively in KDE's "change resolution" (you either have to change
> it at every single reboot, or you might end up with an unusable
> account) - they should implement a fallback mode (which gnome2 had, ah
> the joy of the progress)
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety



More information about the LUG mailing list