|Copyright||(c) Robert Marlow <firstname.lastname@example.org>, 2015 Evgeny Kurnevsky|
|License||BSD3-style (see LICENSE)|
|Maintainer||Robert Marlow <email@example.com>|
Causes the pointer to follow whichever window focus changes to. Compliments the idea of switching focus as the mouse crosses window boundaries to keep the mouse near the currently focused window
You can use this module with the following in your
import XMonad import XMonad.Actions.UpdatePointer
Enable it by including it in your logHook definition, e.g.:
logHook = updatePointer (0.5, 0.5) (1, 1)
which will move the pointer to the nearest point of a newly focused window. The first argument establishes a reference point within the newly-focused window, while the second argument linearly interpolates between said reference point and the edges of the newly-focused window to obtain a bounding box for the pointer.
logHook = updatePointer (0.5, 0.5) (0, 0) -- exact centre of window logHook = updatePointer (0.25, 0.25) (0.25, 0.25) -- near the top-left logHook = updatePointer (0.5, 0.5) (1.1, 1.1) -- within 110% of the edge
To use this with an existing logHook, use >> :
logHook = dynamicLog >> updatePointer (1, 1) (0, 0)
which moves the pointer to the bottom-right corner of the focused window.