I'm running a dual-screen setup and have my trackpad disabled most of the time (which includes hiding the mousepointer).
When I reenable the trackpad (and display the mouse pointer again), I've lost track where the pointer was before.
I'm looking for a tool to highlight the current mouse position (e.g. by a circle). Ideally this would be a single command flashing the circle for a short period of time.
I'm aware that xdotool
can find the current position, yet there is no highlighting; also, key-mon
doesn't provide this functionality.
I've also read that cairo composition manager
provides such functionality, yet I'm wondering if there is a smaller tool to achieve this.
In case there is no such tool: What is the easiest way to display such a circle around the cursor using the data provided by xdotool getmouselocation
?
In case this is relevant: I don't use a desktop environment, just the xmonad
window manager.
Best Answer
While I like Mikeserv's answer for cleverness, it has the downside that it will create a window which "steals" the focus and has to be clicked away. I also find it takes just slightly too long to start: about 0.2 to 0.3 seconds, which is just slightly too slow for a "smooth" experience.
I finally got around to digging into XLib, and clobbered together a basic C program to do this. The visual effect is roughly similar to what Windows (XP) has (from memory). It's not very beautiful, but it works ;-) It doesn't "steal" focus, starts near-instantaneous, and you can click "through" it.
You can compile it with
cc find-cursor.c -o find-cursor -lX11 -lXext -lXfixes
. There are some variables at the top you can tweak to change the size, speed, etc.I released this as a program at https://github.com/arp242/find-cursor. I recommend you use this version, as it has some improvements that the below script doesn't have (such as commandline arguments and ability to click "through" the window). I've left the below as-is due to its simplicity.