PDA

View Full Version : Duel Screens and Desktop Effects



dthomasdigital
April 5th, 2007, 01:11 AM
Any one have any luck getting the Desktop Effects working in Fiesty. I have Duel screens working but I can't get Desktop Effects to work. I have a ATI Radeon X600 with 2 flat screen Dell 1707FP's.....any ideas.

TheMono
April 5th, 2007, 01:37 AM
I may be wrong, but I think the x600 disables dri if you are running it dual head at the moment...

Which driver are you using for it? fgrlx or radeon? (or ati)

dthomasdigital
April 5th, 2007, 05:05 AM
I'm using fgrlx.

dthomasdigital
April 19th, 2007, 08:37 PM
This is a new script I created for switching back and forth between xorg configurations....it works great.
If you need to see my xorg files let me know I'll post them.



#!/bin/sh
#Xorg switcher by dthomasdigital and hackerssidekick
#This script will allow you to choose between two xorg.conf files

SCREEN=`zenity --list --text="Select an xorg.conf" --column="Index" --column="Config" --hide-column=1 1 'Single Monitor' 2 'Dual Monitor'`
if [ $SCREEN = "1" ]; then
zenity --info --text="Switching to Single Monitor X will restart"
rm /etc/X11/xorg.conf
ln -s /etc/X11/xorg.conf.single /etc/X11/xorg.conf
killall Xorg
else
if [ $SCREEN = "2" ]; then
zenity --info --text="Switching to Dual Monitor X will restart"
rm /etc/X11/xorg.conf
ln -s /etc/X11/xorg.conf.dual /etc/X11/xorg.conf
killall Xorg
else
zenity --info --text="Nevermind"
fi
fi

dthomasdigital
April 24th, 2007, 02:45 AM
ne screen two screen we all scream for a screen.
Xorg Switcher Documentation:

There is a small issue in the way which Ubuntu handles the ati graphics (specifically the Radeon X600) card running 3d or opengl applications on a two screen configuration. It has a tendency to run those types of applications either very slowly or not at all. However, when configured to run on a single screen setup, opengl and 3d accelerated applications run with absolutely no limitations.

Why run dual screen if you encounter no limitations on a single screen configuration? For certain tasks such as desktop publishing, web or application development a dual screen configuration is invaluable, but if your playing the latest first person shooter game like Doom3 or Prey, a fast 3D accelerated graphics card is a must.

The solution was to create two separate xorg.conf files, one for a single screen set up and one for a dual screen set up. Creating the two separate xorg.conf files was relatively simple.

Here are the two sample files.
technical note: all files need to be located in \etc\X11\


xorg.config.single


# /etc/X11/xorg.conf (xorg 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(5) 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 "Files"
Fontpath "/usr/share/fonts/X11/misc"
Fontpath "/usr/share/fonts/X11/cyrillic"
Fontpath "/usr/share/fonts/X11/100dpi/:unscaled"
Fontpath "/usr/share/fonts/X11/75dpi/:unscaled"
Fontpath "/usr/share/fonts/X11/Type1"
Fontpath "/usr/share/fonts/X11/100dpi"
Fontpath "/usr/share/fonts/X11/75dpi"
# path to defoma fonts
Fontpath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "vbe"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
Option "XkbOptions" "lv3:ralt_switch"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/wacom"# Change to
Option "Type" "stylus"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
# /dev/input/event
# for USB
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "eraser"
Option "Device" "/dev/wacom"# Change to
Option "Type" "eraser"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
# /dev/input/event
# for USB
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "cursor"
Option "Device" "/dev/wacom"# Change to
Option "Type" "cursor"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
# /dev/input/event
# for USB
EndSection

Section "Device"
Identifier "ATI Technologies Inc RV380 [Radeon X600 (PCIE)]"
Driver "fglrx"
Busid "PCI:1:0:0"
EndSection

Section "Monitor"
Identifier "DELL 1707FP"
Option "DPMS"
EndSection

Section "Screen"
Identifier "Default Screen"
Device "ATI Technologies Inc RV380 [Radeon X600 (PCIE)]"
Monitor "DELL 1707FP"
Defaultdepth 24
SubSection "Display"
Depth 1
Modes "1280x1024" "1152x864" "1024x768" "800x600" "720x400" "640x480"
EndSubSection
SubSection "Display"
Depth 4
Modes "1280x1024" "1152x864" "1024x768" "800x600" "720x400" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "1152x864" "1024x768" "800x600" "720x400" "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "1280x1024" "1152x864" "1024x768" "800x600" "720x400" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "1152x864" "1024x768" "800x600" "720x400" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1152x864" "1024x768" "800x600" "720x400" "640x480"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "Default Layout"
screen "Default Screen"
Inputdevice "Generic Keyboard"
Inputdevice "Configured Mouse"
Inputdevice "stylus" "SendCoreEvents"
Inputdevice "cursor" "SendCoreEvents"
Inputdevice "eraser" "SendCoreEvents"
EndSection

Section "DRI"
Mode 0666
EndSection
Section "Extensions"
Option "Composite" "0"
Option "Composite" "0"
EndSection


The second file you will need is:

xorg.config.dual


# /etc/X11/xorg.conf (xorg 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(5) 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 "Files"
Fontpath "/usr/share/fonts/X11/misc"
Fontpath "/usr/share/fonts/X11/cyrillic"
Fontpath "/usr/share/fonts/X11/100dpi/:unscaled"
Fontpath "/usr/share/fonts/X11/75dpi/:unscaled"
Fontpath "/usr/share/fonts/X11/Type1"
Fontpath "/usr/share/fonts/X11/100dpi"
Fontpath "/usr/share/fonts/X11/75dpi"
# path to defoma fonts
Fontpath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "vbe"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
Option "XkbOptions" "lv3:ralt_switch"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/wacom"# Change to
Option "Type" "stylus"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
# /dev/input/event
# for USB
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "eraser"
Option "Device" "/dev/wacom"# Change to
Option "Type" "eraser"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
# /dev/input/event
# for USB
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "cursor"
Option "Device" "/dev/wacom"# Change to
Option "Type" "cursor"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
# /dev/input/event
# for USB
EndSection

Section "Device"
Identifier "0 ATI Technologies Inc RV380 [Radeon X600 (PCIE)]"
Driver "fglrx"
Busid "PCI:1:0:0"
Screen 0
EndSection

Section "Monitor"
Identifier "Dell 1707FP"
Option "DPMS"
EndSection


Section "Device"
Identifier "1 ATI Technologies Inc RV380 [Radeon X600 (PCIE)]"
Driver "fglrx"
Busid "PCI:1:0:0"
Screen 1
EndSection

Section "Monitor"
Identifier "Dell 1707FP"
Option "DPMS"
EndSection

Section "Screen"
Identifier "Main Screen"
Device "0 ATI Technologies Inc RV380 [Radeon X600 (PCIE)]"
Monitor "Dell 1707FP"
Defaultdepth 24
SubSection "Display"
Depth 1
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 4
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "800x600" "640x480"
EndSubSection
EndSection

Section "Screen"
Identifier "Second Screen"
Device "1 ATI Technologies Inc RV380 [Radeon X600 (PCIE)]"
Monitor "Dell 1707FP"
Defaultdepth 24
SubSection "Display"
Depth 1
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 4
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "800x600" "640x480"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen 0 "Main Screen"
Screen 1 "Second Screen" RightOf "Main Screen"
Inputdevice "Generic Keyboard"
Inputdevice "Configured Mouse"
Inputdevice "stylus" "SendCoreEvents"
Inputdevice "cursor" "SendCoreEvents"
Inputdevice "eraser" "SendCoreEvents"
option "Xinerama"
EndSection

Section "DRI"
Mode 0666
EndSection


Now the not so fun part, to switch back and forth between these two set-ups is a real pain. First you have to be root to change the xorg.conf file. Then you have tp rename the setup file you want to use to xorg.conf while making sure you don't copy over any of your other .conf files. On more than one occasion I corrupted the configuration file and had to install the xorg.conf file by hand in the terminal from a backup. There had to be a better way.


Scripts to the rescue. Xorg Switcher is a Linux script that with the help of zenity makes the task of switching back and forth between different xorg configurations as easy as pressing a button.

Here is the script:


#!/bin/sh
#Xorg switcher by dthomasdigital and hackerssidekick
#This script will allow you to choose between two xorg.conf files

SCREEN=`zenity --list --text="Select an xorg.conf" --column="Index" --column="Config" --hide-column=1 1 'Single Monitor' 2 'Dual Monitor'`
if [ $SCREEN = "1" ]; then
zenity --info --text="Switching to Single Monitor X will restart"
rm /etc/X11/xorg.conf
ln -s /etc/X11/xorg.conf.single /etc/X11/xorg.conf
killall Xorg
else
if [ $SCREEN = "2" ]; then
zenity --info --text="Switching to Dual Monitor X will restart"
rm /etc/X11/xorg.conf
ln -s /etc/X11/xorg.conf.dual /etc/X11/xorg.conf
killall Xorg
else
zenity --info --text="Nevermind"
fi
fi

Don't forget that you will need to make the script executable.

Once you create the script, you will need to place it in a directory. I create a directory called scripts in the home directory. This is just for easy reference and you can place it any where you would like.

The next step is to add a launcher to the panel

First right mouse click on the panel
http://www.mediamax.com/dthomasdigital/Hosted/xorgpic1.png

Click Add to panel and you will see the next window:

http://www.mediamax.com/dthomasdigital/Hosted/xorgpic2.png

Click Custom application Launcher

You will see the next screen:
http://www.mediamax.com/dthomasdigital/Hosted/xorgpic3.png

Enter the following information
http://www.mediamax.com/dthomasdigital/Hosted/xorgpic4.png

A little explanation:

Type: well is an application.
Name: Name of the application (you can call it what ever you want.
Command: gksudo is a great command. When you run the script it will ask you for the root password, (like stated earlier you must have root access to change the xorg.conf file) <full path> is the path where your script is located.
Comment: Add what you would like
Press the No Icon button and select an icon.

Now run the script.

Click on the panel launcher you just created.
http://www.mediamax.com/dthomasdigital/Hosted/xorgpic5.png

Once you do, you will be asked to enter the root password.

You should then see this window.
http://www.mediamax.com/dthomasdigital/Hosted/xorgpic6.png

If you click cancel you will see this window
http://www.mediamax.com/dthomasdigital/Hosted/xorgpic7.png

Click on the desired configuration you want and click the OK button.
http://www.mediamax.com/dthomasdigital/Hosted/xorgpic8.png

You will then see this window. Beware if you click the X to cancel the script will still run (might fix that in a later version)

Once you click the OK button, X will restart. You log back into Gnome and your new xorg.conf will be running.


So that's it, this is all you need to make switching your xorg.conf file as easy as pressing a button. I'd like to thank hackerssidkick from the Ubuntu forums for showing me how to rename the files and turning me on to zenity. If you would like to contact me please email me at dthomasdigital@gmail.com and visit the web site http:\\myweb.cableone.net\dthomas


Look for more script howtos coming soon......

joshdavey
April 25th, 2007, 03:43 AM
hey dthomasdigital,

I got to the last step and I tried running the application launcher but nothing pops up. I created a new file for the script and called it "xorg.switcher" and then placed in /home/scripts/.

The single screen and duel screen scripts are in their appropriate directories as well.

Any idea why the script doesn't launch?

dthomasdigital
April 25th, 2007, 04:15 AM
The first thing I could think of is did you make the script executable?
in a terminal type chmod +x <name of script>
Let me know if that does not work.

dogstar13
April 25th, 2007, 02:26 PM
Any one have any luck getting the Desktop Effects working in Fiesty. I have Duel screens working but I can't get Desktop Effects to work. I have a ATI Radeon X600 with 2 flat screen Dell 1707FP's.....any ideas.

I have an ATI X600 graphics card with dual displays and I am able to run either Beryl or Compiz with no issues using the "radeon" driver in Ubuntu Feisty. There is a limitation with the ATI cards that limits your max resolution to 2048x768 when using effects due to a limitation on the maximum size of a single 3D texture the ATI cards can handle, or at least that is what I have read and it seems to be true. A copy of my xorg.conf file is pasted below. Hope it helps. this article gives a good how to on the subject: http://www.howtoforge.com/ubuntu_feisty_beryl_ati_radeon

-dogstar13




# /etc/X11/xorg.conf (xorg 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(5) 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 "Files"

# path to defoma fonts
FontPath "/usr/share/fonts/X11/misc"
FontPath "/usr/share/fonts/X11/cyrillic"
FontPath "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath "/usr/share/fonts/X11/Type1"
FontPath "/usr/share/fonts/X11/100dpi"
FontPath "/usr/share/fonts/X11/75dpi"
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "dri"
Load "dbe"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "vbe"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
Option "XkbOptions" "lv3:ralt_switch"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"

# /dev/input/event
# for USB
Identifier "stylus"
Driver "wacom"
Option "Device" "/dev/wacom"# Change to
Option "Type" "stylus"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
EndSection

Section "InputDevice"

# /dev/input/event
# for USB
Identifier "eraser"
Driver "wacom"
Option "Device" "/dev/wacom"# Change to
Option "Type" "eraser"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
EndSection

Section "InputDevice"

# /dev/input/event
# for USB
Identifier "cursor"
Driver "wacom"
Option "Device" "/dev/wacom"# Change to
Option "Type" "cursor"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
EndSection

Section "Monitor"
Identifier "Monitor 1"
VendorName "DEL"
ModelName "DELL 1907FP"
HorizSync 30.0 - 81.0
VertRefresh 56.0 - 76.0
Option "DPMS"
EndSection

Section "Device"
Identifier "ATI Technologies Inc RV380 [Radeon X600 (PCIE)]-1"
Driver "radeon"
BusID "PCI:1:0:0"
Option "MergedFB" "true"
Option "MonitorLayout" "LCD, CRT"
Option "CRT2Hsync" "31-100.7"
Option "CRT2VRefresh" "50-160"
Option "OverlayOnCRTC2" "true"
Option "CRT2Position" "RightOf"
Option "MetaModes" "1024x768-1024x768"
Option "XAANoOffscreenPixmaps"
Option "AGPMode" "4"
Option "AGPFastWrite" "true"
Option "DisableGLXRootClipping" "true"
Option "AddARGBGLXVisuals" "true"
Option "AllowGLXWithComposite" "true"
Option "EnablePageFlip" "true"
Screen 0
EndSection

Section "Screen"
Identifier "Default Screen"
Device "ATI Technologies Inc RV380 [Radeon X600 (PCIE)]-1"
Monitor "Monitor 1"
DefaultDepth 24
SubSection "Display"
Depth 1
Modes "1152x864" "1024x768" "800x600" "720x400" "640x480" "256x256"
EndSubSection
SubSection "Display"
Depth 4
Modes "1152x864" "1024x768" "800x600" "720x400" "640x480" "256x256"
EndSubSection
SubSection "Display"
Depth 8
Modes "1152x864" "1024x768" "800x600" "720x400" "640x480" "256x256"
EndSubSection
SubSection "Display"
Depth 15
Modes "1152x864" "1024x768" "800x600" "720x400" "640x480" "256x256"
EndSubSection
SubSection "Display"
Depth 16
Modes "1152x864" "1024x768" "800x600" "720x400" "640x480" "256x256"
EndSubSection
SubSection "Display"
Depth 24
Modes "1152x864" "1024x768" "800x600" "720x400" "640x480" "256x256"
EndSubSection
EndSection

Section "ServerLayout"
Option "AIGLX" "true"
Identifier "DualHead Beryl Layout"
Screen "Default Screen" 0 0
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "stylus" "SendCoreEvents"
InputDevice "cursor" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"
EndSection

Section "DRI"
Mode 0666
EndSection

Section "Extensions"
Option "Composite" "Enable"
EndSection

dthomasdigital
April 25th, 2007, 03:19 PM
Thanks for the info dogstar, I'll give it a shot......

p388l3s
April 30th, 2007, 02:15 AM
@dthomasdigital

have setup my configs and have got the script working, once i have my 3d working this should prove to be one very useful script, thanks a lot!!!

dthomasdigital
April 30th, 2007, 03:37 AM
Hope it helps, let me know if it does....I hope to refine it.

ktulu1115
May 1st, 2007, 12:55 AM
Does anyone know if this same information would apply to someone using the NVIDIA driver? Attached is my xorg.conf

dthomasdigital
May 1st, 2007, 04:56 AM
I see no reason that it should not work with Nvidia drivers

oneloveamaru
July 28th, 2008, 02:19 PM
Hey guys, this script works great. In 7.10 I created a start menu shortcut and ran it as root, so I could just hit a button and go. Now with Hardy, nothing happens when I click on it. If I run it with sudo on the command line it will work but not from the shortcut.

Any ideas??

Nxion
August 5th, 2008, 11:50 PM
ne screen two screen we all scream for a screen.
Xorg Switcher Documentation:

There is a small issue in the way which Ubuntu handles the ati graphics (specifically the Radeon X600) card running 3d or opengl applications on a two screen configuration. It has a tendency to run those types of applications either very slowly or not at all. However, when configured to run on a single screen setup, opengl and 3d accelerated applications run with absolutely no limitations.

Why run dual screen if you encounter no limitations on a single screen configuration? For certain tasks such as desktop publishing, web or application development a dual screen configuration is invaluable, but if your playing the latest first person shooter game like Doom3 or Prey, a fast 3D accelerated graphics card is a must.

The solution was to create two separate xorg.conf files, one for a single screen set up and one for a dual screen set up. Creating the two separate xorg.conf files was relatively simple.

Here are the two sample files.
technical note: all files need to be located in \etc\X11\


xorg.config.single


# /etc/X11/xorg.conf (xorg 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(5) 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 "Files"
Fontpath "/usr/share/fonts/X11/misc"
Fontpath "/usr/share/fonts/X11/cyrillic"
Fontpath "/usr/share/fonts/X11/100dpi/:unscaled"
Fontpath "/usr/share/fonts/X11/75dpi/:unscaled"
Fontpath "/usr/share/fonts/X11/Type1"
Fontpath "/usr/share/fonts/X11/100dpi"
Fontpath "/usr/share/fonts/X11/75dpi"
# path to defoma fonts
Fontpath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "vbe"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
Option "XkbOptions" "lv3:ralt_switch"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/wacom"# Change to
Option "Type" "stylus"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
# /dev/input/event
# for USB
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "eraser"
Option "Device" "/dev/wacom"# Change to
Option "Type" "eraser"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
# /dev/input/event
# for USB
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "cursor"
Option "Device" "/dev/wacom"# Change to
Option "Type" "cursor"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
# /dev/input/event
# for USB
EndSection

Section "Device"
Identifier "ATI Technologies Inc RV380 [Radeon X600 (PCIE)]"
Driver "fglrx"
Busid "PCI:1:0:0"
EndSection

Section "Monitor"
Identifier "DELL 1707FP"
Option "DPMS"
EndSection

Section "Screen"
Identifier "Default Screen"
Device "ATI Technologies Inc RV380 [Radeon X600 (PCIE)]"
Monitor "DELL 1707FP"
Defaultdepth 24
SubSection "Display"
Depth 1
Modes "1280x1024" "1152x864" "1024x768" "800x600" "720x400" "640x480"
EndSubSection
SubSection "Display"
Depth 4
Modes "1280x1024" "1152x864" "1024x768" "800x600" "720x400" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "1152x864" "1024x768" "800x600" "720x400" "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "1280x1024" "1152x864" "1024x768" "800x600" "720x400" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "1152x864" "1024x768" "800x600" "720x400" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1152x864" "1024x768" "800x600" "720x400" "640x480"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "Default Layout"
screen "Default Screen"
Inputdevice "Generic Keyboard"
Inputdevice "Configured Mouse"
Inputdevice "stylus" "SendCoreEvents"
Inputdevice "cursor" "SendCoreEvents"
Inputdevice "eraser" "SendCoreEvents"
EndSection

Section "DRI"
Mode 0666
EndSection
Section "Extensions"
Option "Composite" "0"
Option "Composite" "0"
EndSectionThe second file you will need is:

xorg.config.dual


# /etc/X11/xorg.conf (xorg 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(5) 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 "Files"
Fontpath "/usr/share/fonts/X11/misc"
Fontpath "/usr/share/fonts/X11/cyrillic"
Fontpath "/usr/share/fonts/X11/100dpi/:unscaled"
Fontpath "/usr/share/fonts/X11/75dpi/:unscaled"
Fontpath "/usr/share/fonts/X11/Type1"
Fontpath "/usr/share/fonts/X11/100dpi"
Fontpath "/usr/share/fonts/X11/75dpi"
# path to defoma fonts
Fontpath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "vbe"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
Option "XkbOptions" "lv3:ralt_switch"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/wacom"# Change to
Option "Type" "stylus"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
# /dev/input/event
# for USB
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "eraser"
Option "Device" "/dev/wacom"# Change to
Option "Type" "eraser"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
# /dev/input/event
# for USB
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "cursor"
Option "Device" "/dev/wacom"# Change to
Option "Type" "cursor"
Option "ForceDevice" "ISDV4"# Tablet PC ONLY
# /dev/input/event
# for USB
EndSection

Section "Device"
Identifier "0 ATI Technologies Inc RV380 [Radeon X600 (PCIE)]"
Driver "fglrx"
Busid "PCI:1:0:0"
Screen 0
EndSection

Section "Monitor"
Identifier "Dell 1707FP"
Option "DPMS"
EndSection


Section "Device"
Identifier "1 ATI Technologies Inc RV380 [Radeon X600 (PCIE)]"
Driver "fglrx"
Busid "PCI:1:0:0"
Screen 1
EndSection

Section "Monitor"
Identifier "Dell 1707FP"
Option "DPMS"
EndSection

Section "Screen"
Identifier "Main Screen"
Device "0 ATI Technologies Inc RV380 [Radeon X600 (PCIE)]"
Monitor "Dell 1707FP"
Defaultdepth 24
SubSection "Display"
Depth 1
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 4
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "800x600" "640x480"
EndSubSection
EndSection

Section "Screen"
Identifier "Second Screen"
Device "1 ATI Technologies Inc RV380 [Radeon X600 (PCIE)]"
Monitor "Dell 1707FP"
Defaultdepth 24
SubSection "Display"
Depth 1
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 4
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "800x600" "640x480"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen 0 "Main Screen"
Screen 1 "Second Screen" RightOf "Main Screen"
Inputdevice "Generic Keyboard"
Inputdevice "Configured Mouse"
Inputdevice "stylus" "SendCoreEvents"
Inputdevice "cursor" "SendCoreEvents"
Inputdevice "eraser" "SendCoreEvents"
option "Xinerama"
EndSection

Section "DRI"
Mode 0666
EndSection Now the not so fun part, to switch back and forth between these two set-ups is a real pain. First you have to be root to change the xorg.conf file. Then you have tp rename the setup file you want to use to xorg.conf while making sure you don't copy over any of your other .conf files. On more than one occasion I corrupted the configuration file and had to install the xorg.conf file by hand in the terminal from a backup. There had to be a better way.


Scripts to the rescue. Xorg Switcher is a Linux script that with the help of zenity makes the task of switching back and forth between different xorg configurations as easy as pressing a button.

Here is the script:


#!/bin/sh
#Xorg switcher by dthomasdigital and hackerssidekick
#This script will allow you to choose between two xorg.conf files

SCREEN=`zenity --list --text="Select an xorg.conf" --column="Index" --column="Config" --hide-column=1 1 'Single Monitor' 2 'Dual Monitor'`
if [ $SCREEN = "1" ]; then
zenity --info --text="Switching to Single Monitor X will restart"
rm /etc/X11/xorg.conf
ln -s /etc/X11/xorg.conf.single /etc/X11/xorg.conf
killall Xorg
else
if [ $SCREEN = "2" ]; then
zenity --info --text="Switching to Dual Monitor X will restart"
rm /etc/X11/xorg.conf
ln -s /etc/X11/xorg.conf.dual /etc/X11/xorg.conf
killall Xorg
else
zenity --info --text="Nevermind"
fi
fi Don't forget that you will need to make the script executable.

Once you create the script, you will need to place it in a directory. I create a directory called scripts in the home directory. This is just for easy reference and you can place it any where you would like.

The next step is to add a launcher to the panel

First right mouse click on the panel
http://www.mediamax.com/dthomasdigital/Hosted/xorgpic1.png

Click Add to panel and you will see the next window:

http://www.mediamax.com/dthomasdigital/Hosted/xorgpic2.png

Click Custom application Launcher

You will see the next screen:
http://www.mediamax.com/dthomasdigital/Hosted/xorgpic3.png

Enter the following information
http://www.mediamax.com/dthomasdigital/Hosted/xorgpic4.png

A little explanation:

Type: well is an application.
Name: Name of the application (you can call it what ever you want.
Command: gksudo is a great command. When you run the script it will ask you for the root password, (like stated earlier you must have root access to change the xorg.conf file) <full path> is the path where your script is located.
Comment: Add what you would like
Press the No Icon button and select an icon.

Now run the script.

Click on the panel launcher you just created.
http://www.mediamax.com/dthomasdigital/Hosted/xorgpic5.png

Once you do, you will be asked to enter the root password.

You should then see this window.
http://www.mediamax.com/dthomasdigital/Hosted/xorgpic6.png

If you click cancel you will see this window
http://www.mediamax.com/dthomasdigital/Hosted/xorgpic7.png

Click on the desired configuration you want and click the OK button.
http://www.mediamax.com/dthomasdigital/Hosted/xorgpic8.png

You will then see this window. Beware if you click the X to cancel the script will still run (might fix that in a later version)

Once you click the OK button, X will restart. You log back into Gnome and your new xorg.conf will be running.


So that's it, this is all you need to make switching your xorg.conf file as easy as pressing a button. I'd like to thank hackerssidkick from the Ubuntu forums for showing me how to rename the files and turning me on to zenity. If you would like to contact me please email me at dthomasdigital@gmail.com and visit the web site http:\\myweb.cableone.net\dthomas


Look for more script howtos coming soon......

Ok I have a Dell XPS m1210. The display runs at 1280x800. I also have a 15inch LCD display that runs at 1280x768. Could I just take both of these config files and modify it for my setup? The big differance here is I have a Nvidia 7400go. Will this script work for me?

jijlj
October 3rd, 2009, 07:16 AM
I just modified it to work for me. I could not get the script to work and after 3 evenings of work (and lots of hunting because I am a novice) I got it. I am using a Nvidia GeForce 6200 PCI card on an aopen XCcube edition computer running Ubuntu 9.04. Using this modified script I can switch between 3 different settings: dual monitor, game on large monitor, and TV out cloned to smaller monitor. All without unplugging the cords.

Here is the script I am using:

#!/bin/sh
#Xorg switcher by dthomasdigital and hackerssidekick
#This script will allow you to choose between two xorg.conf files

SCREEN=`zenity --list --text="Select an xorg.conf" --column="Index" --column="Config" --hide-column=1 1 'Game Monitor' 2 'Dual Monitors' 3 'TV & Monitor'`
if [ $SCREEN = "1" ]; then
zenity --info --text="Switching to Game Monitor X will restart."
rm /etc/X11/xorg.conf
ln -s /etc/X11/xorg.conf.game /etc/X11/xorg.conf
killall Xorg
fi
if [ $SCREEN = "2" ]; then
zenity --info --text="Switching to Dual Monitor X will restart."
rm /etc/X11/xorg.conf
ln -s /etc/X11/xorg.conf.dual /etc/X11/xorg.conf
killall Xorg
fi
if [ $SCREEN = "3" ]; then
zenity --info --text="Switching to TV & Monitor X will restart."
rm /etc/X11/xorg.conf
ln -s /etc/X11/xorg.conf.clonetv /etc/X11/xorg.conf
killall Xorg
fi
zenity --info --text="Oops... Nevermind."
fi
fi


I hope this will help others for easy use as it does me.
-JL