"; */ ?>

linux


10
Sep 07

Avant Window Navigator – Dual Monitor Hack

avant window navigator  Ok, so you have successfully configured dual monitor for you (Gnome/KDE) desktop, and now you have decided to take it even further and install and configure Avant Window Navigator – way to go!

    Although most of your installation/configuration will succeed by following one of the tutorials, in case if you have dual monitors, and/or you use Option  "MergedFB"  in "xorg.conf" to merge two monitors into a one screen, standard tutorials will not work. This will require additional hacking to get AWN to work right, and here is where this article comes in :)

    PROBLEM:    One of the problems that AWN has with multiple screens/monitors is to identify the position of where it needs to put its task bar. In case of two monitors merged into one big screen, it does not adjust to this new slightly larger "coordinate system", and fails to place its task bar to the right place on a screen (usually at the bottom of the bottom screen). This can be solved, of course ;)

    SOLUTION:   AWN stores monitor resolution info in a file called "%gconf.xml" which is located here:

          user@host:~/.gconf/apps/avant-window-navigator$ ll
          total 32
          drwx------ 2 user user 4096 2007-07-18 11:41 app
          drwx------ 4 user user 4096 2007-06-26 23:47 applets
          drwx------ 2 user user 4096 2007-08-06 21:52 bar
          -rw------- 1 user user 776 2007-09-10 09:52 %gconf.xml
          -rw------- 1 user user 776 2007-06-27 22:57 %gconf.xml.dual
          -rw------- 1 user user 776 2007-06-27 10:41 %gconf.xml.single
          drwx------ 2 user user 4096 2007-06-27 17:59 title
          drwx------ 2 user user 4096 2007-06-30 14:16 window_manager
          user@host:~/.gconf/apps/avant-window-navigator$

    "%gconf.xml" is an XML file that has several elements called "entry". The ones we are interested in would be:

 
        <entry name="monitor_height" mtime="1179886419" type="int" value="1024">
        </entry>
        <entry name="monitor_width" mtime="1179886419" type="int" value="1280">
        </entry>

    These values would work fine if we had a single 1280×1024 monitor, but if we have our (e.g.) bottom monitor as 1280×800, in order for AWN to display its task bar in a correct spot (the bottom of the bottom monitor), values have to change to:

 
        <entry name="monitor_height" mtime="1179886419" type="int" value="1824">
        </entry>
        <entry name="monitor_width" mtime="1179886419" type="int" value="1280">
        </entry>

    So what we did, we summed up Y-Positions of both monitors together: 1024 + 800 = 1824. Now when AWN is calculating its task bar’s Y-Pos offset, it will take 1824, as the Y-Pos max range, and will do the right thing!


25
Jun 07

Custom Keyboard Layout in Ubuntu (or just Linux :)

keyboard layout in Ubuntu LinuxSystem -> Preferences -> Keyboard -> Layouts -> Add… Right? It is all good and clean only in case if layouts, that come with Ubuntu (or other Linux), are exactly what you need. But what if you’d like to create your own layout? Or, most of the time, what if layout is ok, but you would like to change a couple of keys around, because you are used to it “that certain way”? Here is how to approach these “what if”s.

The “guy” to talk to is XKB (X KeyBoard), which is responsible for everything that is going on with keyboard(s) under X (GUI Environment).

First, let us find the layout to change/modify/customize. For that we will go to “/usr/share/X11/xkb/symbols”:

user@host:/usr/share/X11/xkb/symbols$ ls
ad      by             epo            hr      kh               mk         pl          th
af      ca             es             hu      kr               mm         pt          tj
al      capslock       eurosign       ie      kz               mn         ro          tr
altwin  cd             fi             il      la               mt         ru          ua
am      ch             fo             in      latam            mv         ru_backup   us
ara     compose        fr             inet    latin            nbsp       se          uz
az      cs             fujitsu_vndr/  iq      level3           nec_vndr/  sgi_vndr/   vn
ba      ctrl           gb             ir      level5           ng         si          xfree68_vndr/
bd      cz             ge             is      lk               nl         sk          za
be      de             gh             it      lt               no         sony_vndr/
bg      digital_vndr/  gr             jp      lv               np         srvr_ctrl
br      dk             group          keypad  macintosh_vndr/  pc         sun_vndr/
bt      ee             hp_vndr/       kg      mao              pk         sy

This is home for all layouts that XKB reads in and follows. That means that if a layout needs to be changed all the changes are written here.

Now let’s change a Russian Phonetic (for example) layout to change a couple of keys around. For that, first, make a backup of the existing Russian layout (that has all Russian Layouts):

sudo cp ru ru_backup

then let’s get to breaking through and customizing it (use your favorite text editor, “vi” here is used as an example):

sudo vi ru
 
// $XKeyboardConfig: xkbdesc/symbols/ru,v 1.11 2006/09/04 20:25:10 svu Exp $
 
// based on
// russian standard keyboard
// AEN aen@logic.ru
// 2001/12/23 by Leon Kanter leon@blackcatlinux.com
// 2005/12/09 Valery Inozemtsev shrek@altlinux.ru
//
// $XFree86: xc/programs/xkbcomp/symbols/ru,v 1.3 2003/02/15 22:27:05 dawes Exp $
 
partial default alphanumeric_keys
xkb_symbols "basic" {
 
    name[Group1]= "Russia";
 
    key    AE01 {    [        1,        exclam     ]    };
    key    AE02 {    [        2,        quotedbl    ]    };
    key    AE03 {    [        3,      numbersign    ]    };
    key    AE04 {    [        4,        asterisk    ]    };
    key    AE05 {    [        5,         colon    ]    };
    key    AE06 {    [        6,         comma    ]    };
    key    AE07 {    [        7,        period    ]    };
    key    AE08 {    [        8,     semicolon    ]    };
    key    AE09 {    [        9,     parenleft    ]    };
    key    AE10 {    [        0,    parenright    ]    };
    key    AE11 {    [        minus,    underscore    ]    };
    key    AE12 {    [        equal,          plus    ]    };
    key    BKSL {    [    backslash,             bar    ]    };
    key    AB10 {    [        slash,      question    ]    };
    key LSGT {        [           slash,             bar      ]       };
 
    key    TLDE {    [     Cyrillic_io,     Cyrillic_IO    ]    };
    key    AD01 {    [ Cyrillic_shorti, Cyrillic_SHORTI    ]    };
    key    AD02 {    [    Cyrillic_tse,    Cyrillic_TSE    ]    };
    key    AD03 {    [      Cyrillic_u,    Cyrillic_U    ]    };
    key    AD04 {    [     Cyrillic_ka,     Cyrillic_KA    ]    };
    key    AD05 {    [     Cyrillic_ie,     Cyrillic_IE    ]    };
    key    AD06 {    [     Cyrillic_en,     Cyrillic_EN    ]    };
    key    AD07 {    [    Cyrillic_ghe,    Cyrillic_GHE    ]    };
    key    AD08 {    [    Cyrillic_sha,    Cyrillic_SHA    ]    };
    key    AD09 {    [  Cyrillic_shcha,  Cyrillic_SHCHA    ]    };
    key    AD10 {    [     Cyrillic_ze,     Cyrillic_ZE    ]    };
    key    AD11 {    [     Cyrillic_ha,     Cyrillic_HA    ]    };
    key    AD12 {    [Cyrillic_hardsign,Cyrillic_HARDSIGN    ]    };
    key    AC01 {    [     Cyrillic_ef,     Cyrillic_EF    ]    };
    key    AC02 {    [   Cyrillic_yeru,   Cyrillic_YERU    ]    };
    key    AC03 {    [     Cyrillic_ve,     Cyrillic_VE    ]    };
    key    AC04 {    [      Cyrillic_a,    Cyrillic_A    ]    };
    key    AC05 {    [     Cyrillic_pe,     Cyrillic_PE    ]    };
    key    AC06 {    [     Cyrillic_er,     Cyrillic_ER    ]    };
    key    AC07 {    [      Cyrillic_o,    Cyrillic_O    ]    };
    key    AC08 {    [     Cyrillic_el,     Cyrillic_EL    ]    };
    key    AC09 {    [     Cyrillic_de,     Cyrillic_DE    ]    };
    key    AC10 {    [    Cyrillic_zhe,    Cyrillic_ZHE    ]    };
    key    AC11 {    [      Cyrillic_e,    Cyrillic_E    ]    };
    key    AB01 {    [     Cyrillic_ya,     Cyrillic_YA    ]    };
    key    AB02 {    [    Cyrillic_che,    Cyrillic_CHE    ]    };
    key    AB03 {    [     Cyrillic_es,     Cyrillic_ES    ]    };
    key    AB04 {    [     Cyrillic_em,     Cyrillic_EM    ]    };
    key    AB05 {    [      Cyrillic_i,    Cyrillic_I    ]    };
    key    AB06 {    [     Cyrillic_te,     Cyrillic_TE    ]    };
    key    AB07 {    [Cyrillic_softsign,Cyrillic_SOFTSIGN    ]    };
    key    AB08 {    [     Cyrillic_be,     Cyrillic_BE    ]    };
    key    AB09 {    [     Cyrillic_yu,     Cyrillic_YU    ]    };
 
    key.type[group1]="TWO_LEVEL";
 
    include "keypad(comma)"
};
 
partial alphanumeric_keys
xkb_symbols "winkeys" {
    include "ru(basic)"
    name[Group1]= "Russia - Winkeys";
    key AE03 {        [               3,      numerosign      ]       };
    key AE04 {        [               4,       semicolon      ]       };
    key AE05 {        [               5,         percent      ]       };
    key AE06 {        [               6,           colon      ]       };
    key AE07 {        [               7,        question      ]       };
    key AE08 {        [               8,        asterisk      ]       };
    key AB10 {        [          period,           comma      ]       };
    key BKSL {        [       backslash,           slash      ]       };
};
 
partial alphanumeric_keys
xkb_symbols "typewriter" {
    include "ru(basic)"
    name[Group1]= "Russia - Typewriter";
    key    TLDE {    [      apostrophe,      quotedbl    ]     };
    key    AE01 {    [       exclam,         1     ]    };
    key    AE02 {    [      numerosign,         2    ]    };
    key    AE03 {    [        slash,         3    ]    };
    key    AE04 {    [    semicolon,         4    ]    };
    key    AE05 {    [        colon,         5    ]    };
    key    AE06 {    [        comma,         6    ]    };
    key    AE07 {    [       period,         7    ]    };
    key    AE08 {    [      underscore,         8    ]    };
    key    AE09 {    [     question,         9    ]    };
    key    AE10 {    [      percent,
        0    ]    };
    key    BKSL {    [    parenleft,    parenright    ]    };
 
    key    AD12 {    [Cyrillic_hardsign,Cyrillic_HARDSIGN    ]    };
    key    AB10 {    [     Cyrillic_io,     Cyrillic_IO    ]    };
};
 
partial alphanumeric_keys
xkb_symbols "phonetic" {
 
    name[Group1]= "Russia - Phonetic";
 
    key    AE01 {    [        1,        exclam     ]    };
    key    AE02 {    [        2,            at    ]    };
    key    AE03 {    [        3,     Cyrillic_io     ]    };
    key    AE04 {    [        4,     Cyrillic_IO    ]    };
    key    AE05 {    [        5, Cyrillic_hardsign       ]    };
    key    AE06 {    [        6, Cyrillic_HARDSIGN    ]    };
    key    AE07 {    [        7,     ampersand    ]    };
    key    AE08 {    [        8,        asterisk    ]    };
    key    AE09 {    [        9,     parenleft    ]    };
    key    AE10 {    [        0,    parenright    ]    };
 
    key    AB09 {    [       period,       greater    ]    };
    key    AB10 {    [        slash,      question    ]    };
    key    AB08 {    [        comma,          less    ]    };
    key    AC10 {    [    semicolon,         colon    ]    };
    key    AC11 {    [      apostrophe,      quotedbl    ]    };
    key    LSGT {    [          bar,     brokenbar    ]    };
 
    key    TLDE {    [     Cyrillic_yu,     Cyrillic_YU    ]    };
    key    LatQ {    [     Cyrillic_ya,     Cyrillic_YA    ]    };
    key    LatZ {    [     Cyrillic_ze,     Cyrillic_ZE    ]    };
    key    LatS {    [     Cyrillic_es,     Cyrillic_ES    ]    };
    key    LatA {    [      Cyrillic_a,    Cyrillic_A    ]    };
    key    LatW {    [     Cyrillic_ve,     Cyrillic_VE    ]    };
    key    LatC {    [    Cyrillic_tse,    Cyrillic_TSE    ]    };
    key    LatX {    [Cyrillic_softsign,Cyrillic_SOFTSIGN    ]    };
    key    LatD {    [     Cyrillic_de,     Cyrillic_DE    ]    };
    key    LatE {    [     Cyrillic_ie,     Cyrillic_IE    ]    };
    key    LatV {    [    Cyrillic_zhe,    Cyrillic_ZHE    ]    };
    key    LatF {    [     Cyrillic_ef,     Cyrillic_EF    ]    };
    key    LatT {    [     Cyrillic_te,     Cyrillic_TE    ]    };
    key    LatR {    [     Cyrillic_er,     Cyrillic_ER    ]    };
    key    LatN {    [     Cyrillic_en,     Cyrillic_EN    ]    };
    key    LatB {    [     Cyrillic_be,     Cyrillic_BE    ]    };
    key    LatH {    [     Cyrillic_ha,     Cyrillic_HA    ]    };
 
    ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
 
};

inside the file we’ll find the layout we are after, which is specified by the following line:

xkb_symbols "phonetic"

after this line all the mapping is done.

Now let’s look at the letters we would like to change keys for:

    key    LatX {    [Cyrillic_softsign,Cyrillic_SOFTSIGN    ]    };
    key    LatH {    [     Cyrillic_ha,     Cyrillic_HA    ]    };
    key    AE12 {    [    Cyrillic_che,    Cyrillic_CHE    ]    };

A single line above means that the “key <such and such> will map to [ small, and capital ] Russian letter”. So to change this all that needs to be done is to re-map them. For example, if we want <LatX> (just a latin X, or ‘X’ key) to map to “Cyrillic_ha, Cyrillic_HA” instead of “Cyrillic_softsign,Cyrillic_SOFTSIGN”, we just need to change it:

    key    LatX {    [     Cyrillic_ha,     Cyrillic_HA    ]    };

Here is how these three letters were changed, so they are more convinient to use as a part of the Russian Phonetic layout from the past:

    key    AE12 {    [Cyrillic_softsign,Cyrillic_SOFTSIGN    ]    };
    key    LatX {    [     Cyrillic_ha,     Cyrillic_HA    ]    };
    key    LatH {    [    Cyrillic_che,    Cyrillic_CHE    ]    };

Now just save the file and exit out from it (in vi it is “:wq”), and restart X (press “Ctrl + Alt + backspace”).

You’ve got yourself a new customized layout now that you can use – enjoy!


2
Jun 07

Switch Between Dual/Single Monitor on (Ubuntu) Linux

xorg logo ubuntuRecently I wrote a howto on dual monitor configuration, which works great for my setup. However one thing that is not that great is switching between two modes: dual and single monitor. At work I have an external monitor that I use (which means I use two monitors – my laptop’s and external one), but whenever I am not at work I only need to use my laptop’s. Since all the xorg configuration resides in xorg.conf file, and this file is a regular static text file that is used by X (window system – gdm, kdm, etc.) when it starts, it is nontrivial to change this configuration while running X without some X tools. Unfortunately, Ubuntu is not that fancy (yet) and does not provide these tools by default, so here is a way to do it (sort of) manually.

What we can do is to create two xorg.conf files – "xorg.conf.single" and "xorg.conf.dual". In "xorg.conf.single" just comment out the following line from ServerLayout section:

# /etc/X11/xorg.conf (xorg X Window System server configuration file)
#
.....
Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          0 "0 Screen"
        #Screen         1 "1 Screen" Above "0 Screen"   <-- comment out this line
        Option          "Xinerama" "on"
        Option          "Clone" "off"
.....
EndSection

Here is the listing of "xorg" files that I have:

user@host:/etc/X11$ ll xorg.conf*
-rw-r--r-- 1 root root 4457 2007-06-02 15:05 xorg.conf
-rw-r--r-- 1 root root 4456 2007-05-22 22:03 xorg.conf.dual
-rw-r--r-- 1 root root 4457 2007-05-22 22:04 xorg.conf.single

Now the idea is simple - before X (I use Gnome Desktop, but it can be any desktop environment) starts, we need to copy xorg file that we need (dual or single) to "xorg.conf", which will be picked and loaded by X.

In /home/user/ directory we have a .bashrc file that is loaded whenever the user logs in (if we use bash shell, which is a most popular shell anyway). Therefore we can leverage this file to define aliases that we would like to use once we login. Since alias can be anything we'd like, why not make a dual/single commands as aliases? Here is an example:

user@host:/etc/X11$ tail -5 /home/user/.bashrc
# restart gdm with dual monitor support
alias xdual='sudo cp /etc/X11/xorg.conf.dual /etc/X11/xorg.conf; sudo /etc/init.d/gdm restart'

# restart gdm with single monitor support
alias xsingle='sudo cp /etc/X11/xorg.conf.single /etc/X11/xorg.conf; sudo /etc/init.d/gdm restart'

Now when we need to switch between dual/single monitor, we can fire up shell (by pressing Ctrl+Alt+1, or gnome-terminal, or kterm, etc.) and type xsingle or xdual whichever we need.


28
May 07

Ubuntu Dell – Three Real Models

Welcome to DELL Open Source

You asked, we listened. For advanced users and tech enthusiasts, we’re happy to offer a new open-source operating system, so you can dive in and truly enjoy a PC experience just the way you want it. In addition to the FreeDOS systems we already offer, we are proud to announce PCs with Ubuntu.

dell pcs featuring ubuntu

 
    So far only these three models are for sale with Ubuntu on them:

Dimension E520 N
Intel® Core™2 Duo Processor E4300 (1.8GHz, 800 FSB)
Ubuntu Desktop Edition version 7.04
1GB Dual Channel DDR2 SDRAM at 667MHz- 2DIMMs
250GB Serial ATA Hard Drive (7200RPM) w/DataBurst Cache™
Inspiron E1505 N
Intel® Pentium® dual-core proc T2080(1MB Cache/1.73GHz/533MHz FSB
Ubuntu Edition version 7.04
512MB Shared Dual Channel DDR2 SDRAM at 533MHz, 2 DIMM
80GB 5400rpm SATA Hard Drive
XPS 410 N
Intel® Core™ 2 Duo Processor E4300 (2MB L2 Cache,1.8GHz,800FSB)
Ubuntu Desktop Edition version 7.04
1GB Dual Channel DDR2 SDRAM at 667MHz – 2 DIMMs
250GB Serial ATA 3Gb/s Hard Drive (7200RPM) w/DataBurst Cache™

 

 


18
May 07

Dual Monitor on Ubuntu 7.04 (Feisty Fawn) – nc2400 with Intel 945GM

xorg logoOne of the good things about being in a big consulting company is that you get these "once every one/two years" laptop upgrades. So my lucky upgrade day was yesterday, and my friend Dell D400 was upgraded to HP nc2400. So I decided to change my course a little, and use Ubuntu on a company laptop (instead of XP). I talked to the company people, they did not mind, which was great! The only problem is, when you get a new Windows XP laptop (upgrade), there are certain people that set it up for you, and you just pick it up and go to the client. Well, in my case I had to get up to speed very quickly myself. And of course one of majors problems with Ubuntu Feisty (as with most Linux distros) it does not have any tooling to deal with dual (laptop/LCD) monitors. So it was a fun time experimenting with "xorg.config". It took me quite some time, but I DID GET IT WORKING! And just want to share with everybody what I came with, since none of the Ubuntu forums, and none of what Google (with their new Web 2.0) told me did NOT work.

So here we go… Checking what graphic (video) my new nc2400 has:

user@host:~$ lspci
...
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller (rev 03)<br />
...

Ok, so I’ve got "Intel 945GM" – cool. Notice that there are two VGA/Display controllers, one is on 0:2:0, and another one is on 0:2:1 (those numbers are BusIDs by the way). Nevertheless, I used only one BusID, which is the first one 0:2:0 to get it working.

I also have 1280×800 laptop screen resolution, which means I need to get 915resolution

apt-get install 915resolution

Now, my External Monitor has 1280×1024 @ 60 Hz by specs. Let’s see it is supported by 915resolution:

user@host:~$ sudo 915resolution -l
Password:
Intel 800/900 Series VBIOS Hack : version 0.5.2
 
Chipset: 945GM
BIOS: TYPE 1
Mode Table Offset: $C0000 + $269
Mode Table Entries: 36
 
Mode 30 : 640x480, 8 bits/pixel
Mode 32 : 800x600, 8 bits/pixel
Mode 34 : 1024x768, 8 bits/pixel
Mode 38 : 1280x800, 24 bits/pixel
Mode 3c : 1920x1440, 8 bits/pixel
Mode 41 : 640x480, 16 bits/pixel
Mode 43 : 800x600, 16 bits/pixel
Mode 45 : 1024x768, 16 bits/pixel
Mode 49 : 1280x800, 16 bits/pixel
Mode 4d : 1920x1440, 16 bits/pixel
Mode 50 : 640x480, 32 bits/pixel
Mode 52 : 800x600, 32 bits/pixel
Mode 54 : 1024x768, 32 bits/pixel
Mode 58 : 1280x800, 32 bits/pixel
Mode 5c : 1920x1440, 32 bits/pixel

Seems like I do not have 1280×1024 as one of the supported modes. Hmmm. Ok, then I need to explicitly ask for it by modifying this file, to look like this:

user@host:~$ cat /etc/default/915resolution
#
# 915resolution default
#
# find free modes by  /usr/sbin/915resolution -l
# and set it to MODE or set to 'MODE=auto'
#
# With 'auto' detection, the panel-size will be fetched from the VBE
# BIOS if possible and the highest-numbered mode in each bit-depth
# will be overwritten with the detected panel-size.
MODE=3a
#
# and set resolutions for the mode.
# e.g. use XRESO=1024 and YRESO=768
 
XRESO=1280
YRESO=1024
 
# We can also set the pixel mode.
# e.g. use BIT=32
# Please note that this is optional,
# you can also leave this value blank.
BIT=24

Ok. No I still need to patch laptop LCD to 1280×800, therefore im going to write  a one liner script that is going to do that on startup (how-to). Here is that one line:

# Set the laptop monitor resolution
# Add it to 915Resolution supported modes
915resolution 38 1280 800 24

Did, resolution, did the patching, is it now time for an "xorg.conf"? Ok, then, here it is (working too) :)

# /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"
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"
        Identifier      "Synaptics Touchpad"
        Driver          "synaptics"
        Option          "SendCoreEvents"        "true"
        Option          "Device"                "/dev/psaux"
        Option          "Protocol"              "auto-dev"
        Option          "HorizScrollDelta"      "0"
EndSection
 
Section "InputDevice"
        Driver          "wacom"
        Identifier      "stylus"
        Option          "Device"        "/dev/input/wacom"
        Option          "Type"          "stylus"
        Option          "ForceDevice"   "ISDV4"         # Tablet PC ONLY
EndSection
 
Section "InputDevice"
        Driver          "wacom"
        Identifier      "eraser"
        Option          "Device"        "/dev/input/wacom"
        Option          "Type"          "eraser"
        Option          "ForceDevice"   "ISDV4"         # Tablet PC ONLY
EndSection
 
Section "InputDevice"
        Driver          "wacom"
        Identifier      "cursor"
        Option          "Device"        "/dev/input/wacom"
        Option          "Type"          "cursor"
        Option          "ForceDevice"   "ISDV4"         # Tablet PC ONLY
EndSection
 
Section "Device"
        Identifier      "0 Intel 945GM"
        Driver          "i810"
        BusID           "PCI:0:2:0"
        Screen      0
        Option          "MonitorLayout" "CRT,LFP"
        Option          "DRI" "false"
    # I don't think these next lines are actually required.
    #Option          "BackingStore" "true"
    #Option          "DevicePresence" "on"
    #Option          "DisplayInfo" "FALSE"
    #Option          "DRI" "true"
    #Option                       "CacheLines" "1024"
EndSection
 
Section "Device"
        Identifier      "1 Intel 945GM"
        Driver          "i810"
        BusID           "PCI:0:2:0"
        Screen      1
        Option          "MonitorLayout" "CRT,LFP"
        Option          "DRI" "true"
    # I don't think these next lines are actually required.
    #Option          "BackingStore" "true"
    #Option          "DevicePresence" "on"
    #Option          "DisplayInfo" "FALSE"
    #Option          "DRI" "true"
    #Option                       "CacheLines" "1024"
EndSection
 
Section "Monitor"
        Identifier      "0 nc2400 Monitor"
        Option          "DPMS"
        Option          "DPMS"
#       HorizSync       28-75
#       VertRefresh     43-100
EndSection
 
Section "Monitor"
        Identifier         "1 nc2400 Monitor"
    HorizSync      30 - 83
    VertRefresh    56 - 76
    Option         "DPMS"
        Modeline       "1280x1024@60" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync
EndSection
 
Section "Screen"
        Identifier          "0 Screen"
        Device              "0 Intel 945GM"
        Monitor             "0 nc2400 Monitor"
        DefaultDepth    24
        SubSection "Display"
                Depth           24
                Modes           "1280x800"
        EndSubSection
EndSection
 
Section "Screen"
        Identifier          "1 Screen"
        Device              "1 Intel 945GM"
        Monitor             "1 nc2400 Monitor"
        DefaultDepth    24
        SubSection "Display"
                Depth           24
                Modes           "1280x1024@60"
        EndSubSection
EndSection
 
Section "ServerLayout"
        Identifier      "Default Layout"
    Screen      0 "0 Screen"
    Screen      1 "1 Screen" RightOf "0 Screen"
        Option          "Xinerama" "on"
        Option          "Clone" "off"
        InputDevice     "Generic Keyboard"
        InputDevice     "Configured Mouse"
        InputDevice     "stylus"        "SendCoreEvents"
        InputDevice     "cursor"        "SendCoreEvents"
        InputDevice     "eraser"        "SendCoreEvents"
        InputDevice     "Synaptics Touchpad"
EndSection
 
Section "DRI"
        Mode    0666
EndSection

You may notice "Modeline "1280×1024@60" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync", well I just got it from the same place you would get it, yea..that’s right, I got it from Google.

Remember, no matter what a general opinion is (linux follows "install without restart" philosophy), you have to restart. And not just /etc/init.d/gdm restart, but a FULL system restart,

Ok, so now you should see two beautiful screens – one is your laptop, and the other one is your external monitor which is now a separate screen. Congrats!

If you have any questions – shoot, I killed so much time figuring out all these details, why should you?