• Stars
    star
    270
  • Rank 152,189 (Top 3 %)
  • Language
    Python
  • Created almost 11 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fake XRandR configurations for multi-head setups with crappy video drivers, like fakexinerama but with xrandr

FakeXRandR

This is a tool to cheat an X11 server to believe that there are more monitors than there actually are. It hooks into libXRandR and libXinerama and replaces certain, configurable monitor configurations with multiple virtual monitors. A tool that comes with this package can be used to configure how monitors are split.

This tool used to only work with XRandR, but I found it useful to add Xinerama emulation. It can be readily removed if it isn't needed though.

Note that this tool right now only works for legacy Xlib applications. Applications using xcb will not work. See issue #22 for progress on xcb support.

Also note: With xrandr 1.5, this library shouldn't be needed anymore for most users. xrandr has an abstraction for "monitors" now which should work out of the box, at least with applications written using one of the big GUI frameworks.

Use cases

You'll want to use this library if you have a multi-head setup, but a crappy video driver which tells RandR that there is only one big monitor, resulting in wrong window placement by window managers. Matrox Tripple Head 2 Go et al. are other candidates, where there really is only one big monitor, but you'd want to split it anyway. Another use case is to test multi-head behaviour without having multiple monitors.

Licensing

You may use, redistribute and modify this program under the terms of the GNU General Public License (GPL) Version 3, in the version available under the URL http://www.gnu.org/licenses/gpl.html#.

Authors

  • Phillip Berndt
  • Geoffrey 'gnif' McRae
  • Gerry Demaret
  • Audrius Butkevicius

Installation

In most cases, simply run make, then install using make install. This will determine where the library should be installed and where the originals reside. Pay attention to any warnings/errors from the configure script. To compile the library, you will need the XRandR and X11 development packages for your distribution.

In case of Ubuntu, install the following prerequisites:

 sudo apt-get install xorg-dev libglu1-mesa-dev build-essential \
 python3-gi python-gi-dev python-gi-cairo

After installation, use the fakexrandr-manage tool to create a configuration (in ~/.config/fakexrandr.bin).

For Arch Linux, there is a PKGBUILD (git) by Philipp Schmitt.

Manual installation

If you need FakeXRandR for another use case or the automated building does not work for you, here are some details:

The configure script creates a config.h header with the path to the system's real libXrandr.so file and a path which preceeds that of the real library in the ld search path, where the FakeXRandR should be placed. You can use ldconfig -v to get a list of suitable directories, if configure should fail to determine one.

The libXrandr.c file only contains a initialization function which loads the symbols from the real library and implementations of the functions that we actually override and which require more than replacement of XIDs for fake screens with real the one's. All other functions are automatically generated by make_skeleton.py from the default Xrandr header file.

How to

After installation, you have a tool fakexrandr-manage available. It starts a GUI if you have PyGObject installed and falls back to a command line interface elsewise. You can manually use the CLI if you run fakexrandr-manage help. In the GUI, use the select box at the top to choose an output that you want to split and click "Create". It will be identified by its resolution and EDID, which is a device specific identifier. A monitor will be drawn below.

FakeXRandr configuration

You can add splits by drawing horizontal and vertical lines with your mouse. To split an output into top and bottom part, draw a horizontal line, i.e. use your mouse like you would use scissors to cut a sheet of paper. You can move existing lines with the left mouse button, and remove them by right-clicking. When you close the configuration tool, you will be asked whether you want to save the altered configuration. Other programs, including your window manager, might need to be restarted before they begin to use the new configuration.

FAQ

  • How can I see if it's working?
    Run ldd xrandr. libXrandr.so should show up in /usr/local/lib. Then, start xrandr. Any split screens should show up multiple times, with ~1, ~2, etc. appended to their names. After you restarted your X11 session, fullscreening applications using Xrandr (e.g. GTK apps) should fullscreen to the virtual screen, not the physical one.
  • Changing settings of the fake screen doesn't have any effect?!
    XRandR is only used to communicate information on the resolution and output settings between X11 server, graphics driver and applications. It is up to the graphics driver to actually apply any settings. Since FakeXRandR only hooks into the X11 ↔ application communication, attempts to change settings for fake screens won't have any effect.
  • My two screens are mirrored. Does this library help?
    No. See the FAQ in the Gist for FakeXinerama (see "See also" section).

TODO

  • The program currently relies on the OS caching the configuration file in system memory. Since many programs will read it often, it would be useful to cache it ourselfes, in XResources (see an old revision for some Python code in the management tool regarding that), via a daemon, or shared memory.

  • Support libxcb

See also

  • https://gist.github.com/phillipberndt/7688785 For my version of Fake xinerama, based on Kris Maglione's version. Note that this is now included in FakeXRandR.

  • Unfortunately, many background and slideshow applications are not working with fakerandr. Here is a background slideshow that is explicitly programmed to work with fakerandr: fakexrandr-background (It is third-party and not developed from the fakerandr programmers)

More Repositories

1

autorandr

Auto-detect the connected display hardware and load the appropriate X11 setup using xrandr
Python
2,484
star
2

pqiv

Powerful image viewer with minimal UI
C
307
star
3

bostree

A C implementation of a self-balancing order statistic AVL tree
C
17
star
4

scripts

Useful everyday scripts, in no particular order. Among others: A HTTP(2)(S)/FTP/DAV server, a find(1) like utility, a Python library to bind to privileged ports, a generic unpacker script and a transparent proxy redirector using namespaces.
Python
14
star
5

upnprd

UPnP relay daemon
C
11
star
6

python-imports.vim

A VIM plugin to manage Python import statements
Vim Script
6
star
7

vimconfig

My VIM configuration. Includes a small update script and links to other projects I consider useful.
Vim Script
4
star
8

iwebd

iwebd combines a bunch of means to share files over the local network in a single monolith: http, ftp, dlna, webdav
Go
2
star
9

ChooseableOutgoingCalls

Workaround android bug 58097: Let the user choose the application to use for placing calls from the contacts app
Java
2
star
10

Uebungszettel

An exercise sheet aggregator service
PHP
2
star
11

lossdma

(Lo)cal (s)mtp (s)erver for (d)isposable (m)ail (a)ddresses
C
2
star
12

ctester

A small C unit testing framework that tries to be like GTest
C
2
star
13

photoprism-syncthing-workflow

My workflow for synchronizing pictures from my Smartphone to Photoprism and replacing them with compressed versions on the phone to save space
Shell
1
star
14

web_password_safe

A safe place for your passwords. Polulate on your server, access from mobile devices.
HTML
1
star