[conspire] Things to look for, on the external-monitor matter

Rick Moen rick at linuxmafia.com
Tue Apr 16 17:16:06 PDT 2013


It's a pretty good question:  What exactly do you use to quickly make
your Linux/X11 setup able to deal with an external monitor, e.g., 
you've just arrived at Symantec to give a presentation to SVLUG on you
laptop?

The primitives provide by X.org for this are called XRandR (aka RandR),
the X Resize, Rotate, and Reflect Extension.
http://en.wikipedia.org/wiki/RandR

xrandr(1) 

NAME
       xrandr - primitive command line interface to RandR extension

[...]

DESCRIPTION
       Xrandr  is  used  to set the size, orientation and/or reflection of the
       outputs for a screen. It can also set the screen size.


The Debian docs have some good points
(http://wiki.debian.org/XStrikeForce/HowToRandR12):

  II.3. Adding/removing heads dynamically

  The old days where you had to restart X when plugging a new monitor are
  gone. With RandR 1.2, you can plug/unplug monitors whenever you want.
  Running the following line will query all outputs and enable them with
  their default mode:

  $ xrandr --auto

  You may also disable one output using:

  $ xrandr --output LVDS --off

  This may be useful for some buggy application that don't support
  multiple outputs well. Also, due to CRTC limitations (see the Caveats
  section below), it is often required to disable one output before
  enabling another since most hardware only support 2 at the same time.

Or like this:

$ xrandr --output VGA --right-of LVDS --auto

A question basically the same as Tony's got asked and answered/discussed
on Stackexchange.com:

http://unix.stackexchange.com/questions/4489/a-tool-for-automatically-applying-randr-configuration-when-external-display-is-p

  Is there a tool which enables one to:

  o  remember current RandR configuration (position, orientation, resolution
     etc) on per-monitor basis,

  o  automatically apply last known good configuration as soon as the display
     is plugged in, with no need to muck around with applets or xrandr(1)?
     The configurations would have to be applied on a per-user, per-display
     basis.

  If there is no such tool in the wild, I'd like to throw together one
  myself, but as far as I can see, there's no way to tell that a monitor
  has been plugged in. Do I have to poll with xrandr -q once in a while to
  figure out that an output was connected or disconnected, or is there a
  more efficient way to do it? Can udev be tuned to do just that?

Answers included a nice little hackable shell script and a mention of
'autorandr', https://github.com/wertarbyte/autorandr
('Automatically select a display configuration based on connected
devices').

The answers also mention that if you're using the proprietary Nvidia
drivers, you cannot user the xrandr primitives, and so must install and
use Disper, http://willem.engen.nl/projects/disper/ .







More information about the conspire mailing list