trinity-users@lists.pearsoncomputing.net

Message: previous - next
Month: December 2015

Re: [trinity-users] Re: Configuring two monitors connected to the same computer

From: Rolf Schmidt <rolf.frogs@...>
Date: Tue, 22 Dec 2015 19:06:15 +0100
Hi Ken,

I do it in the following way:

I have two scripts in /etc/trinity/tdm

1st script - name xrand.sh
#######################################################################
#!/bin/sh
# usage: xrand.sh start|stop | Monitor-Typ

case "$1" in
stop)
    /usr/bin/xrandr --output VGA1 --off
  ;;
X193W)
    # for an Acer x193W
    /usr/bin/xrandr --output VGA1 --mode "1440x900" --left-of LVDS1 \
   --output LVDS1 --mode "1024x768"
  ;;
L1800P)
    # for an LG Flattron L1800P mit identischer Aufl�sung wie Laptop
    /usr/bin/xrandr --output VGA1 --mode "1024x768" --right-of LVDS1 \
    --output LVDS1 --mode "1024x768"
  ;;
text)
    # LG Flattron L1800P rotated for work with text documents
    /usr/bin/xrandr --output VGA1 --mode "1280x1024" --rotate left \
   --left-of LVDS1 --output LVDS1 --mode "1024x768"
  ;;
*)
    echo $0 stop | X193W | L1800P | text
  ;;
esac
########################################################################

The 2nd script - name getMonitor.sh
########################################################################
#! /bin/bash

# x193w and l1800p are the names of the motiors written out in
# Xorg-log-file

grep -i x193w /var/log/Xorg.0.log > /dev/null

if [ "${?}" == "0" ]
then
  # found Acer monitor - set resolution
  /etc/trinity/tdm/xrand.sh X193W
  exit
fi
grep -i l1800p /var/log/Xorg.0.log > /dev/null
if [ "${?}" == "0" ]
then
  # LG 1800P fund - set resolution
  /etc/trinity/tdm/xrand.sh L1800P
  exit
fi
########################################################################

This scripts will be called from Xstartup also located in
/etc/trinity/tdm. The skript starts with:

#! /bin/sh
# Xstartup - run as root before session starts

if [ -e /etc/trinity/tdm/getMonitor ]; then
  /etc/trinity/tdm/getMonitor
fi
....

So what does it do?
On startup it looks, if the acer (or the LG) is conneted to my lenovo
laptop, and if so the wantet resolution and screen-positon (left or
right of) will be set.

After that you can see multi monitors in trinity contol center.

Hope that helps and
merry christmas and a happy new year

Rolf


Attachments: