1
0
Lock a mouse cursor to a single monitor for multi-seat setups. https://aweirdimagination.net/2019/06/02/lightweight-multiseat-x/
Go to file
2019-07-07 14:42:00 -07:00
.gitignore Initial commit 2019-06-02 01:36:07 +00:00
LICENSE Initial commit 2019-06-02 01:36:07 +00:00
monitor-lock-xcb.py Make top/bottom barriers large enough to avoid triggering hidden panels. 2019-07-07 14:42:00 -07:00
monitor-lock.py Make top/bottom barriers large enough to avoid triggering hidden panels. 2019-07-07 14:42:00 -07:00
README.md Wrote README. 2019-06-01 18:50:14 -07:00

monitor-lock

Lock a cursor to a single monitor using XFIXES 5.0 barriers to stop the cursor from moving off the specified screen. If the cursor is not presently on that screen, then it can be moved onto it but not back off of it.

The intention is for this to be used in conjunction with the multi-pointer X support of XInput2 to create a multi-seat setup where different pointers are assigned to different monitors, but it may have other uses.

Run it once without arguments to see the options for devices and screens. For example, the output may look like this:

$ ./monitor-lock.py 
Found XFIXES version 5.0
Found XInputExtension version 2.0
Found XINERAMA version 1.1

Available screens:
screen 0: {'x': 0, 'y': 0, 'width': 3840, 'height': 2160}
screen 1: {'x': 3840, 'y': 0, 'width': 1920, 'height': 1200}
screen 2: {'x': 3840, 'y': 1200, 'width': 1920, 'height': 1080}

Available pointers:
device 2: Virtual core pointer

USAGE: ./monitor-lock.py [device] [screen]

Then running

./monitor-lock.py 2 0

would keep the (in this example, only) cursor on the 3840x2160 monitor for as long as monitor-lock.py was still running.