Files
nixos-config/home/common
Miguel Palhas 4028c55d56 hyprland: add wl-kbptr, patched for HiDPI and rotated outputs
Keyboard control of the mouse pointer. SUPER+G labels detected targets and
clicks one; SUPER+SHIFT+G falls back to tile -> bisect for anything detection
misses.

Stock wl-kbptr 0.4.1 is unusable on this setup, for two unrelated reasons:

- Target detection is hardcoded for ~1080p. filter_rects() discards any
  candidate with height >= 50 or width >= 500, so on a 4K screen at scale = 1
  nearly every real control is dropped for being "too big" and only emoji and
  avatars survive — a full Slack window produced ~8 labels, all on images.

- On the rotated monitor the pointer landed in the wrong place. move_pointer()
  takes output->width/height from xdg_output.logical_size, which is already
  rotated, then applies the transform again. Asking for global (4000,1000) on
  DP-2 landed at (4286,3726); the double rotation predicts (4301,3736).

Neither is exposed as a config option, hence the overrideAttrs. Sizes in the
config file are likewise doubled: wl-kbptr paints raw cairo onto a layer
surface and never sees a scale factor, so upstream's defaults render half-size.

Both binds are pidof-guarded: wl-kbptr only exits on a keypress, so an overlay
that loses focus first sits there holding an exclusive keyboard grab.
2026-08-17 13:39:37 +01:00
..