Hallo,
Mijn eerste bericht hier, en meteen iets moois :-)
Ben de afgelopen weken bezig met Linux aan de praat krijgen op mijn laptop. En omdat ik nogal wat wensen heb is het wat gezoek.
Eén van die wensen is dat ik mijn externe monitor aan de praat krijg: of laptop scherm óf extern scherm.
Mijn PC:
ASUS V6VA 8007P
- ATI Mobility Radeon X700
- LCD van 1400x1024
Externe monitor: Samsung SyncMaster 226bw
Na veel zoeken en uitproberen:
- De standaard driver heb je nodig (zie xorg.conf)
- Onderstaand xorg.conf
- En met daaronderstaand script kun je de monitor switchen (opslaan en dan chmod +x doen om het uitvoorbaar te maken)
- Wat ik heb gedaan is een starter maken in het menu die het script aanroept en tevens het script laten aanroepen bij booten (Voorkeuren->Sessies).
De xorg.conf:
# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
Option "XkbVariant" "intl"
Option "XkbOptions" "lv3:ralt_switch"
EndSection
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
EndSection
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizEdgeScroll" "0"
EndSection
Section "Device"
Identifier "Configured Video Device"
#Driver "fglrx" # Use standard Open Source Driver
EndSection
Section "Monitor"
Identifier "Configured Monitor"
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
Defaultdepth 24
SubSection "Display"
Depth 24
Modes "1680x1050" "1280x800" "1024x768" "800x600" # Screen modes
Virtual 1680 1050 # Actual mode
EndSubSection
EndSection
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
Inputdevice "Synaptics Touchpad"
EndSection
#Section "Module" # Don't load other driver!
# Load "glx"
#EndSection
En hier het script:
#!/bin/bash
#
# Switch screens (auto):
#
# JdB 27/08/2008
# echo "Check if screen is connected and current output."
EXT="VGA-0"
INT="LVDS"
# Check if External screen is connected
xrandr |grep $EXT | grep " connected "
if [ $? -eq 0 ]; then
# Yes connected!
# Figure out current state
STATE=$($SU xrandr | grep ^$INT | grep con | sed "s/.*connected //" | sed "s/(.*//")
# EXTERNAL_STATE=$($SU xrandr | grep ^$EXT | grep con | sed "s/.*connected //" | sed "s/(.*//")
if [ -z "$STATE" ]; then
# Now external, so switch to Laptop
# echo "Switching to Laptop-screen."
xrandr --output VGA-0 --off # External screen off
xrandr --output LVDS --auto # Laptop screen on
else
# Now external, so switch to External
# echo "Switching to External VGA screen."
xrandr --output VGA-0 --auto # External VGA screen on
xrandr --output LVDS --off # Laptop screen off
fi
else
# No external screen connected.
echo "No external screen detected, stay with Laptop screen."
fi
exit 0
Heb nog een klein probleempje:
Als ik switch (dmv bovenstaand script) verdwijnt mijn muispointer. Als ik dan een programma start dan is de muis weer zichtbaar.
Groet!