You know on Windows how you can press Ctrl and it'll spawn some contracting circles to show you where your mouse cursor is; is there a way to do that on Linux?

@rjt not what you are asking, but I copy/pasted a small utility from stackoverflow, that moves the mouse pointer (using XWarpPointer) by a specified relative delta_x/delta_y:

Warning: no error checking, if less than two arguments are provided then it may crash with out of bounds memory read. The fix is one line, something like ```if (! (argc > 2)) return 1;``` at the start of `main()`.

You can move the mouse cursor to the corners of the screen by specifying +/- huge numbers. From the top left corner you can move to the center of the screen by parsing the resolution from the output of `xrandr` (or you could hardcode values if you know your screen).

This solves the problem of "put mouse cursor in known position", not "find position of mouse cursor".

@mathr Thanks! That gives me some ideas if I wanna sit down and try to script something.

@rjt Don't know what window manager you're using, but may or may not contain the relevant setting for you.


gsettings set org.gnome.settings-daemon.peripherals.mouse locate-pointer true
Use "false" to turn this off. This option should be in GNOME tweak tool too (Keyboard & Mouse section).

In Compiz: "Show cursor" plugin ("compiz-plugins-extra")

In KDE: default on, combination is Ctrl+Meta


Sorry, should've specified I guess, I'm not using a DE, I'm using i3.

Thanks though!

Sign in to participate in the conversation

An instance for people that make stuff. Doesn't matter if you DIY, work on your car, your garden, do art, cook, make music, or anything else. Toot about it here