Fake Xinerama is a replacement libXinerama library that instead of querying the XServer reads ~/.fakexinerama and provides fake information about Xinerama screens based on this file. It can be used to fake a Xinerama setup even on computers with just one monitor or to fake Xinerama setup other than one specified in the XServer configuration (e.g. making one screen smaller when using two same screens). It's probably only useful for developers.
The source code is here. It's based on the Xinerama source from XOrg v6.9. To build it, just do something like
gcc -O2 -Wall Xinerama.c -fPIC -o libXinerama.so.1.0 -shared ln -s libXinerama.so.1.0 libXinerama.so.1 ln -s libXinerama.so.1 libXinerama.so
Then use LD_PRELOAD, put the library somewhere in your LD_LIBRARY_PATH or you can even replace your system libXinerama.
The format of the file is rather strict. Lines beginning with # are comments. First line is one number, specifying number of screens. This line must be followed by this number of lines, each containing four numbers: X Y W H, i.e. screen's X and Y origin, width and height. For example, for two Xinerama screens, left one being 1280x960 and right one being 1280x1024:
2 0 0 1280 960 1280 0 1280 1024
Note: I consider this to be a developer's tool. I'm not interested in converting it to use autotools, proper packaging, making the hardcoded 10 screens maximum configurable or anything similar. It works.
Lubos Lunak <l.lunak suse.cz> <l.lunak kde.org>