X dual head, one graphic card
X configuration
Goal : 2 separate X screens working as dual-head(like 2 mice, 2 keyboards), powered by one graphic card(nvidia ion, 1st gen).
features used :
First configure the X server through xorg.conf :
Screen 0 is placed X coordinates 1500 to prevent the pointer from going from one screen to the other (Screen 1 X size is 1360).
Xinerama disabled... this should be self explanatory.
For each screen, there has to be a relevant screen section, monitor section, and device section (yes, 2 device sections, even for just
one physical device). the whole xorg.conf is attached. I do admit, that most of this xorg.conf was generated by nvidia-settings.
Now X is running, 2 separate screens. one with KDE running, to run anything, it needs to be run from console with the DISPLAY variable set to :0.1 .
Now to set up MPX : first create a new master pointer device (in this case named enna) and get its ID :
the last command attaches input from the imon IR receiver to the "enna" pointer. (sory for the weird symbols, I have an encoding problem that is yet to be solved)
Now we have to move the "enna" pointer from screen 0 to screen 1. I havent yet found a nice way to do this, so I hacked together a piece of C code to do just that :
Compile using `gcc -lXi -o movepointer`
an voilà, pointer focus from the iMon is on the second screen, which acts as a second head. For now all this is done through a script run by kdm when it starts. I'll attach it later (after I make it find the device ID, not having everything statically), along with cleaner C code.
TODO : still haven't found a way to stop kdm/kde from resetting the X server (thus killing the media center on the second screen) upon logout.
Credit for the C code goes to mostly to David Mohr who's code I copied, and kept stripping till it did exactly what I wanted.
Goal : 2 separate X screens working as dual-head(like 2 mice, 2 keyboards), powered by one graphic card(nvidia ion, 1st gen).
features used :
- X multiple screens (Zaphod mode?)
- MPX (multiple input X)
First configure the X server through xorg.conf :
Code:
Section "ServerLayout"
Identifier "Monitor"
Screen 0 "Screen0" 1500 0
Screen 1 "Screen1" 0 0 #LeftOf "Screen0"
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
Option "Xinerama" "0"
EndSection
Xinerama disabled... this should be self explanatory.
For each screen, there has to be a relevant screen section, monitor section, and device section (yes, 2 device sections, even for just
one physical device). the whole xorg.conf is attached. I do admit, that most of this xorg.conf was generated by nvidia-settings.
Now X is running, 2 separate screens. one with KDE running, to run anything, it needs to be run from console with the DISPLAY variable set to :0.1 .
Now to set up MPX : first create a new master pointer device (in this case named enna) and get its ID :
Code:
$xinput create-master enna
$xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech Optical USB Mouse id=6 [slave pointer (2)]
⎜ ↳ iMON Remote (15c2:0039) id=7 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Logitech USB Receiver id=8 [slave keyboard (3)]
↳ Logitech USB Receiver id=9 [slave keyboard (3)]
↳ Power Button id=10 [slave keyboard (3)]
↳ Power Button id=11 [slave keyboard (3)]
⎡ enna pointer id=12 [master pointer (13)]
⎜ ↳ enna XTEST pointer id=14 [slave pointer (12)]
⎣ enna keyboard id=13 [master keyboard (12)]
↳ enna XTEST keyboard id=15 [slave keyboard (13)]
$xinput reattach 7 12
Now we have to move the "enna" pointer from screen 0 to screen 1. I havent yet found a nice way to do this, so I hacked together a piece of C code to do just that :
Code:
#include <X11/extensions/XInput2.h>
int main(){
Display *XSession = XOpenDisplay(NULL);
int OriginScreen = 0;
int pID = 12;
int opcode,event,error;
if (!XQueryExtension(XSession,"XInputExtension", &opcode, &event,&error)){
printf("X Input extension not available");
return -1;
}
XIWarpPointer(XSession, pID, None, RootWindow(XSession,
1), 0,0,0,0,0,0);
XCloseDisplay(XSession);
}
an voilà, pointer focus from the iMon is on the second screen, which acts as a second head. For now all this is done through a script run by kdm when it starts. I'll attach it later (after I make it find the device ID, not having everything statically), along with cleaner C code.
TODO : still haven't found a way to stop kdm/kde from resetting the X server (thus killing the media center on the second screen) upon logout.
Credit for the C code goes to mostly to David Mohr who's code I copied, and kept stripping till it did exactly what I wanted.
Total Comments 0




