Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

7 Commits

Repository files navigation

Mouse Mover

A lightweight Python script that periodically moves your mouse to simulate activity.
This helps prevent your computer from going idle, locking, or entering sleep mode due to inactivity.

Features

  • ⏱️ Move the mouse every X minutes (customisable).
  • 🎲 Adds small random offsets to make movement appear natural.
  • 🖥️ Works on Windows, macOS, and Linux.
  • 🛑 Stop anytime with Ctrl+C.

Requirements

Install with:

pip install pyautogui

Usage

Run the script

python mouse_mover.py

Change interval

By default, the mouse moves every 5 minutes. To change this, edit the following line in mouse_mover.py:

move_mouse_every_x_minutes(5)

Example:

move_mouse_every_x_minutes(2) # every 2 minutes

Example output

Mouse mover started. Moving every 5 minutes. Press Ctrl+C to stop.
Mouse moved to: (1024, 580)
Mouse moved to: (1132, 612)
...

Notes

  • On macOS, you may need to grant accessibility permissions: System Preferences → Security & Privacy → Accessibility.
  • For background/automatic runs, consider using Task Scheduler (Windows) or cron jobs (macOS/Linux).

Project Structure

mouse-mover-python/
│── mouse_mover.py # Main script
│── requirements.txt # Dependencies
│── README.md # Documentation
└── .gitignore # Git ignore file

See also

  • roscodetech/claude-caffeinate — same problem space, different mechanism. Uses the OS power-management API (SetThreadExecutionState on Windows, caffeinate on macOS, systemd-inhibit on Linux) instead of input simulation. Drops in as a /caffeinate slash command for Claude Code. Prefer it when you can run a process that holds the wake-lock; mouse-mover is the universally-compatible fallback for restricted endpoints, locked-down corporate machines, or apps that explicitly check for input rather than power state.

License

This project is licensed under the MIT License – free to use and modify.

About

A lightweight Python script that periodically moves your mouse to simulate activity, preventing your computer from going idle, locking, or entering sleep mode due to inactivity.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages