Is there any X option to run 2 different resolutions on LCD and external monitor?

Is there any X option to run 2 different resolutions on LCD and external monitor?

Post by Alex Yu » Thu, 19 Apr 2001 07:28:34



I have a laptop (Toshiba) with a docking station.  I figured out how
to control my resolution on LCD screen 1024x768 and external monitor
1280x1024.  But I don't know how to do it automatically.  I am running
XFree 3.3.4 and I have 2 "XF86Config" files (one for each).  I always
have to restart the X server when I dock or undock my laptop since
there is a change on the resolution.

Is there any setting/option which I can put in "XF86Config" so that I
don't have to restart the X server?  Ideally, it can detect the
ejection from the docking station and switch to the lower resolution
on the LCD screen.  Or it sends the resolution of 1280x1024 to the
external monitor and 1024x768 to the LCD with virtual desktop of
1280x1024.  Thanks for any suggestion.

 
 
 

Is there any X option to run 2 different resolutions on LCD and external monitor?

Post by Michael Meissne » Thu, 19 Apr 2001 11:25:30


aly...@lucent.com (Alex Yung) writes:
> I have a laptop (Toshiba) with a docking station.  I figured out how
> to control my resolution on LCD screen 1024x768 and external monitor
> 1280x1024.  But I don't know how to do it automatically.  I am running
> XFree 3.3.4 and I have 2 "XF86Config" files (one for each).  I always
> have to restart the X server when I dock or undock my laptop since
> there is a change on the resolution.

> Is there any setting/option which I can put in "XF86Config" so that I
> don't have to restart the X server?  Ideally, it can detect the
> ejection from the docking station and switch to the lower resolution
> on the LCD screen.  Or it sends the resolution of 1280x1024 to the
> external monitor and 1024x768 to the LCD with virtual desktop of
> 1280x1024.  Thanks for any suggestion.

Here is the script I use on my Toshiba Tecra 8000 to detect the docking station
at bootup.  I have it installed as /etc/rc.d/rc{3,4,5}.d/S48dock.  You will
have to adjust things like the scanpci, ifconfig, and route lines at least.  It
also assumes that if you are running a 2.2 kernel, you are using Xfree-3.x and
if you are running a 2.4 kernel, you are using Xfree-4.x, which is true for my
laptop, which I was running Red Hat 6.2 Linux on it until I updated it to Red
Hat 7.1 beta.

Note, X is not able to switch resolutions of the virtual display after the
session is started.  You can switch to display a subset of the virtual display
via alt-control-{plus,minus} toggling, but you will find the virtual screen is
still the same size.  However, if you are willing to live with that, you could
define in your XF86Config file two different resolutions, say 1024x768 and
1280x1024 with different timings, and use alt-control-{plus,minus} to switch
between the resolutions.

#!/bin/bash
#
# dock  -- set up for using the docking station/port replicator

# Source function library.
. /etc/rc.d/init.d/functions

if [ "$(type -type action)" != "function" ]; then
        # Run some action. Log its output.
        action() {
                STRING="$1"
                echo -n "$STRING "
                shift
                eval ${1+"$*"}
                rc=$?
                if [ "$?" -ne 0 ]; then
                        echo ", failed exit code $?"
                else
                        echo
                fi
                return $rc
        }
fi

# See how we were called.
case "$1" in
  start)
        # Load ethernet controller
        version=`uname -r`
        if /usr/X11R6/bin/scanpci | egrep -qs 'vendor 0x1179 device 0x0611' \
           && [ -f "/lib/modules/$version/net/eepro100.o" -o -f "/lib/modules/$version/kernel/drivers/net/eepro100.o" ]; then
                if egrep -qs eepro100 /proc/modules; then
                        action "Eepro100.o is already loaded" true

                else
                        action "Load eepro100.o" modprobe eepro100
                fi

                for x in ntp.conf resolv.conf; do
                        if cmp -s /etc/$x /etc/$x-home; then
                                :
                        else
                                action "Update /etc/$x" ln -s -f /etc/$x-home /etc/$x
                        fi
                done

                if cmp -s /etc/printcap.local /etc/printcap-home; then
                        :
                else
                        action "Update /etc/printcap.local" ln -sf /etc/printcap-home /etc/printcap.local
                fi

                # Don't rely on dhcpcd in case tiktok is down, so do this by hand.
                action "Run ifconfig" ifconfig eth0 up <ip-address> broadcast <broadcast> netmask <netmask> && \
                action "Setup route" route add -net default gw <gateway> && \
                action "Sleep for a few seconds to allow for settling" sleep 5

                for x in rc3.d rc4.d rc5.d; do
                        cd /etc/rc.d/$x
                        if [ -e S60nfs ]; then
                                :
                        else
                                ln -s ../init.d/nfs S60nfs
                        fi
                done

                cd /etc/X11
                case "$version" in
                        2[.]2[.]*)      ext="";;
                        *)              ext="-4";;
                esac

                if cmp -s "XF86Config${ext}" "XF86Config${ext}-ext"; then
                        :

                else
                        action "Switching X config file to external monitor support" \
                                ln -sf "XF86Config${ext}-ext" "XF86Config${ext}"
                fi

        else
                cd /etc/X11
                case "$version" in
                        2[.]2[.]*)      ext="";;
                        *)              ext="-4";;
                esac

                if cmp -s "XF86Config${ext}" "XF86Config${ext}-ext"; then
                        action "Switching X config file to use internal screen, touchpoint" \
                                ln -sf "XF86Config${ext}-touchpoint" "XF86Config${ext}"
                fi

                rm -f /etc/rc.d/rc[345].d/S60nfs
        fi
        ;;

  stop)
        # Unload network controller
        if egrep -sq eepro100 /proc/modules; then
                if ifconfig eth0 >& /dev/null; then
                        action "Taking down network" ifdown eth0
                else
                        action "Network is already down" true
                fi

                action "Unloading eepro100.o" rmmod eepro100
        fi
        ;;

  restart)
        $0 stop
        $0 start
        ;;

  status)
        version=`uname -r`
        if /usr/X11R6/bin/scanpci | egrep -qs 'vendor 0x1179 device 0x0611' \
           && [ -f "/lib/modules/$version/net/eepro100.o" ]; then
                if egrep -qs eepro100 /proc/modules; then
                        echo "Eepro100.o is loaded"
                else
                        echo "Eepro100.o is not loaded"
                fi

                if ifconfig eth0 >& /dev/null; then
                        echo "Network is up"

                else
                        echo "Network is down"
                fi
        fi
        ;;

  *)
        echo "Usage: dock {start|stop|status|restart}"
        exit 1
esac

exit 0

--
Michael Meissner, Red Hat, Inc.  (GCC group)
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:     meiss...@redhat.com                phone: +1 978-486-9304
Non-work: meiss...@spectacle-pond.org        fax:   +1 978-692-4482

 
 
 

Is there any X option to run 2 different resolutions on LCD and external monitor?

Post by Ian Stirlin » Tue, 08 May 2001 06:11:57



>I have a laptop (Toshiba) with a docking station.  I figured out how
>to control my resolution on LCD screen 1024x768 and external monitor
>1280x1024.  But I don't know how to do it automatically.  I am running
>XFree 3.3.4 and I have 2 "XF86Config" files (one for each).  I always
>have to restart the X server when I dock or undock my laptop since
>there is a change on the resolution.

Does changing display resolutions work?

Ctrl-Alt-+

xvidtune -next
will switch to the next mode also, I don't know if you can say what mode
you want to switch to.
XF86VidModeSwitchToMode or similar is the appropriate call.

I don't know how you'd find when it docks.

--

---------------------------+-------------------------+--------------------------
"Melchett  : Unhappily Blackadder, the Lord High Executioner is dead
Blackadder : Oh woe! *ed of course.
Melchett   : No, oddly enough no. They usually are but this one just got
             careless one night and signed his name on the wrong dotted line.
             They came for him while he slept."                - Blackadder II

 
 
 

1. How to configure for LCD and external monitor?

Hello,

I am running Linux 2.0.32 on a Winbook XL (C&T 65554 video
chip) and have a working XF86Config for 800x600 resolution
(I'd like higher resolution, but that's another story).

I also have an XF86Config that gives 1152x864 (or whereabouts)
for my external CTX monitor.

My question is: is there a way to have a single XF86Config
that automatically gives the highest resolution possible,
whichever of the two monitors I'm using?

Suppose I start X with my external monitor "active". I want
the 1152x864 Modeline to take effect. Then,
I toggle to the LCD Monitor; I want 800x600 to take
effect.

I don't actually need to be able to toggle back and forth. I
would just like the appropriate resolution to take effect
for the monitor I start with.

If it's not possible to design an XF86Config that does this,
is there an X/xinit command-line option that will allow me
to choose the appropriate configuration file when I
know which monitor I'm using?

Thanks for all advice,

 - Ian

2. Viewsonic 20g

3. Any LCD 17" monitor at 1024x768 optimal resolution?

4. REPOST: Size of Java process - differs on other os?

5. Fedora Core 3 - I cannot set my monitor to be LCD and change its resolution.

6. Welcome to comp.unix.shell [Frequent posting]

7. Looking for a 17" lcd monitor - high resolution

8. sxpc and term

9. External Monitor != LCD; so now what?

10. Laptop: LCD + External Monitor

11. IBM T23 laptop with LCD and External monitor at same time??

12. laptop with widescreen LCD display on external monitor

13. Simultaneous display on laptop's external monitor and internal LCD