I put the script into the Xsession.d directory so it gets started for every user on boot: /etc/X11/Xsession.d/98vgaonly and made it executable.
The actual script line is this:
xrandr -q | grep ‘VGA connected’ && xrandr --output LVDS --off --output VGA --auto
It checks if the line ‘VGA connected’ was found in xrandr’s query and then asks your X server to turn off the internal output and use the external one with automatic resolution detection.
So to automatically switch to a connected VGA during boot just execute:
i see it’s using the VGA output that xrandr -q is detecting, which is correct for my setup, but im not sure about the other bits like xsession.d and 98vgaonly.
i see what the creator has done, but im not sure on the ins/outs of what this command is actually doing. can someone clarify please…
a) it is suitable for openSUSE use (11.2 x64)?
b) will it only detect & switch during boot up, or does it detect when the external display is connected when when suse is running?
c) if A is not true, then how can it be moddified for SUSE use?
It would probably be possible to somehow call this script automatically when plugging in a monitor, but I’ve not figured out how. xrandr only works when called from inside the running X session in my experience.
I think it is suitable for oS 11.2, but you have to adjust it for the xrandr output.
the issues seem to be the end of the second command with the ‘| tee …’ part. once i press enter, i get a > prompt (similar to the nslookup > prompt). i cant seem to work out why it’s doing that, unless terminal doesnt like copy&pasting…
>
> that bit seems fine - yes i did check xrandr -q.
>
> the issues seem to be the end of the second command with the ‘| tee
> …’ part. once i press enter, i get a > prompt (similar to the
> nslookup > prompt). i cant seem to work out why it’s doing that, unless
> terminal doesnt like copy&pasting…
Incomplete/incorrect command line. You probably have a “’” too more or
less, ie, not paired, or not the correct one.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Minas Tirith))