Feb 042010
 

Two small utilities for use with old-school dual head setups: namely not
twinview / one big desktop, but rather two X screens. See gentoo wiki for some setup help.

I use this setup because the wrapping the mouse is very smooth, it is very useful to have the logical separation of both screens and now I can easily switch focus and mouse between them just by using the keyboard. Additionally, when I play some nice games in wine, I can lock the mouse into each individual screen, and by need be switch by using the keyboard shortcut.

You xorg.conf needs to contain something similar to:

Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          0 "Screen 0" 3000 0
        Screen          1 "Screen 1" 0 0 #leftOf "Screen 0"
EndSection

for these utilities to work.

mouse-switchscreen

Change the mouse cursor from one screen to the other. Remembers the previous
mouse position for each screen.

The previous mouse-switchscreen has been renamed to mouse-wrapscreen (see below), since the name was confusing.

mouse-wrapscreen

If you have an xorg.conf where both X screens are “separated” on the X
coordinates, then the mouse cursor cannot cross. Which is sometimes desired,
and sometimes not. Using mouse-wrapscreen you can configure them to be
“uncrossable”, and then run it in the background when you do want to be able
to cross the cursor.

Warning (2010-02-04): Mouse-wrapscreen seems to lock up the X server after a recent upgrade on my system. The symptom is that the cursor will just jump back and forth between screens, preventing any other interaction between the user and the X server. The reason is unknown, probably mouse-wrapscreen is triggering a bug in X. If you have any further information or ideas, please contact the author.

”Note: Both use XWarpCursor, which was necessary with xorg 7.4. I haven’t tried
it on older versions of xorg.”

Both tools are based on a program by David Antliff. See the header of the
respective .c files for a brief changelog.

Releases

  • 0.5 (2009-05-17)
    Update for xorg 7.4 and integrate “switchscreen” (prev. homepage is defunct)

http://dsp.mcbf.net/releases/dualscreen-mouse-utils-0.5.tar.gz

Related work

There is switchscreen out there by Sampo Niskanen, however it does not seem to remember the mouse position for each screen.

  2 Responses to “DualscreenMouseUtils”

  1. Hi David
    Just dowloaded dualscreen-mouse-utils-0.5.tar.gz.
    I noticed a missing colon for “s” in arg parsing:

    166c166
    - while ((c = getopt_long(argc, argv, "f:hvVs", long_options, NULL)) != -1)
    + while ((c = getopt_long(argc, argv, "f:hvVs:", long_options, NULL)) != -1)

    (This causes a nil-dereference when calling the program w/ -s)
    Cheers Bernd

  2. […] 针对这个问题以前也搜索过,但是没找到什么好方法。这两天不死心继续搜索,发现一个叫做dualscreen-mouse-utils的工具,但是在我的Fedora21系统上却工作不正常。那个mouse-switchscreen一直报错,我不懂X编程,无能为力了…… […]

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>