Application to display temporary "mouse trail" on screen

For my teaching, I wished I had a tool to display a temporary “mouse trail” on the screen. That would allow to highlight things (drawing an arrow, or circling an area). The idea would be that the trail “fades” after a few seconds.
Since I could not find such a desktop effect, I thought of possibly programming an application that covers the entire screen with a transparent overlay, and that would pass through all mouse events except for recording the movement to draw the trail (for example, after activation by a keyboard shortcut).
How could that best be realized?

Or does such a tool already exist?

There is the “Mouse Mark” desktop effect which does what you want, except you’ll have to clear the trail manually.

1 Like

If you want to take a shot at modifying this to make it fade automatically after some time, src/plugins/mousemark · master · Plasma / KWin · GitLab is where the code lives.

Thank you for pointing me to “mousemark”, which is close to what I want to do.

I checked out and compiled KWin from the repo (tag v5.24.4, which matches my system).

This is probably a rather dumb question, but so far I have not figured out how to isolate the code and turn it into a separately compilable and installable plugin.

It’s one of kwin’s built-in effects, so it’s already in your KDE installation. Just enable it in system settings - workspace - desktop effects.

Yes, but I would like to modify it (see above). Therefore I would like to first transform it into a plugin that I can install and test out separately (under a new name).