Skip to content

Repository files navigation

Mouse Trail

A lightweight, portable mouse trail effect for Windows that runs silently from your system tray. Perfect for screen recordings, presentations, or just adding a fun visual effect to your cursor!

Mouse Trail Demo Python

Features

  • System Tray Integration - Runs quietly in the background, no console window
  • Click-Through Overlay - Completely transparent to clicks, won't interfere with your work
  • Toggle On/Off - Easy control via right-click menu in system tray
  • Multi-Monitor Support - Works seamlessly across all displays
  • Fully Portable - No installation required, just run and go
  • Customizable - Easily adjust trail length, color, and thickness

Quick Start

1. Install Dependencies (One Time)

Double-click install_dependencies.bat or run:

pip install -r requirements.txt

2. Launch the App

Double-click start_mouse_trail.pyw or start_tray.bat

The app will start silently and appear in your system tray (bottom-right corner).

3. Control the Trail

Right-click the tray icon to access:

  • Toggle Trail - Turn the mouse trail on/off
  • Exit - Close the application

Requirements

  • Windows 10 or later
  • Python 3.7+
  • Dependencies (auto-installed via install_dependencies.bat):
    • pyautogui - Mouse position tracking
    • pillow - Icon generation
    • pystray - System tray integration

Customization

Edit mouse_trail_tray.pyw around line 25 to customize the trail:

self.trail_length = 13        # Number of trail segments (default: 13)
self.trail_color = '#FF33AA'  # Trail color in hex (default: hot pink)
self.line_width = 7           # Trail thickness in pixels (default: 7)

Auto-Start on Boot

To start Mouse Trail automatically when Windows boots:

  1. Right-click start_mouse_trail.pyw and create a shortcut
  2. Press Win + R, type shell:startup, and press Enter
  3. Move the shortcut to the Startup folder that opens

Project Structure

MouseTrails/
├── start_mouse_trail.pyw      # Main launcher (double-click this!)
├── start_tray.bat             # Alternative batch launcher
├── mouse_trail_tray.pyw       # Core application code
├── install_dependencies.bat   # One-click dependency installer
├── requirements.txt           # Python package requirements
├── QUICK_START.txt           # Simple getting started guide
├── README.md                 # This file
├── .gitignore                # Git ignore rules
└── old versions/             # Previous versions of the script

Troubleshooting

App closes immediately:

  • Run install_dependencies.bat to ensure all packages are installed
  • An error dialog should appear if dependencies are missing

Can't find tray icon:

  • Check the hidden icons area (click the up arrow ^ in system tray)
  • Look for a pink circular icon

Trail doesn't appear:

  • Right-click the tray icon and ensure "Toggle Trail" is checked

Need to see error messages:

  • Run from command line: python mouse_trail_tray.pyw
  • This will display any errors in the console

How It Works

The application creates a transparent, click-through overlay window that spans all monitors. It tracks your mouse position using pyautogui and draws a fading trail effect on a tkinter canvas. The trail gradually disappears when the mouse stops moving.

Key technical features:

  • Uses Windows API (ctypes) to make the window click-through and always-on-top
  • Multi-threaded design separates the trail rendering from the tray icon
  • Efficient canvas updates at ~60 FPS for smooth animation
  • Dynamic opacity and width tapering for a natural trail effect

License

Free to use and modify for personal or commercial use.

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

Author

Created as a portable screen recording tool. Originally designed for demonstrating cursor movement in tutorials and presentations.


Enjoy your mouse trail! If you find this useful, please star the repository ⭐

About

A tiny applet I made to give myself a custom mouse trail.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages