Giter VIP home page Giter VIP logo

fakexrandr's Introduction

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.

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

fakexrandr's People

Contributors

phillipberndt avatar audriusbutkevicius avatar gerryd avatar nmschulte avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.