logo
 
Henning Mersch

Diplom-Informatiker
My tech blog
There is a huge range of projects, which I would like to have a look. Some are fascinating, some might not.
So this blog presents technology, I looked at, but (for me) it is not an every days life utility.
rssFeed





Ubuntu 8.10 / Intrepid hint: Xrandr Leave a Comment

One of the most annoying challenge while upgrading Ubuntu was the usage of Xrandr of Intrepid / 8.10.

As some of you might know, I love to use two screen, which was done by Xinerama within xorg.conf before. This has changed! Xrandr allows dynamically change of the layout during runtime by command line sth. like this:

xrandr --output DVI-D_2 --auto --output VGA_1\
--mode 1280x1024 --right-of DVI-D_2

(just type "xrandr" and have a look for your screen names) Fine - but: Do I really have to start this command every boot? No! A lot of forums suggest to write a /etc/init.d script, which is executed during boot - doesnt work for me! But I read at thinkpad the real solution (in my optinion): Xsession script at login-time.
Here is mine, which has to be put to
/etc/X11/Xsession.d/45custom_xrandr-settings

------------
# from
# http://www.thinkwiki.org/wiki/Xorg_RandR_1.2
# If an external monitor is connected, place it with xrandr

# External output may be "VGA" or "VGA-0" or "DVI-0" or "TMDS-1"
# radeon EXTERNAL_OUTPUT="VGA-0"
EXTERNAL_OUTPUT="VGA_1"
EXTERNAL_OUTPUT_MODE="--mode 1280x1024"

INTERNAL_OUTPUT="DVI-D_2"
# EXTERNAL_LOCATION may be one of: left, right, above, or below
EXTERNAL_LOCATION="right"

case "$EXTERNAL_LOCATION" in
left|LEFT)
EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
;;
right|RIGHT)
EXTERNAL_LOCATION="--right-of $INTERNAL_OUTPUT"
;;
top|TOP|above|ABOVE)
EXTERNAL_LOCATION="--above $INTERNAL_OUTPUT"
;;
bottom|BOTTOM|below|BELOW)
EXTERNAL_LOCATION="--below $INTERNAL_OUTPUT"
;;
*)
EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
;;
esac

xrandr |grep $EXTERNAL_OUTPUT | grep " connected"
if [ $? -eq 0 ]; then
xrandr --off --output $INTERNAL_OUTPUT --auto \
--output $EXTERNAL_OUTPUT $EXTERNAL_OUTPUT_MODE $EXTERNAL_LOCATION
else
xrandr --output $INTERNAL_OUTPUT --auto \
--output $EXTERNAL_OUTPUT --off
------------

Beside this, there were a lot of pitfalls and bugs I came across - maybe enough stuff for another post. For now you just might have a look at my continuous growing list of subscribed bugs of Ubuntu's launchpad. From my point of view the worst Ubuntu release ever!



Author: hmersch Sunday 15.03.09






Valid XHTML 1.0! Valid CSS!
last change:July 4, 2010