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.
- ⏱️ 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.
- Python 3.7+
- pyautogui
Install with:
pip install pyautogui
python mouse_mover.py
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
Mouse mover started. Moving every 5 minutes. Press Ctrl+C to stop.
Mouse moved to: (1024, 580)
Mouse moved to: (1132, 612)
...
- 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).
mouse-mover-python/
│── mouse_mover.py # Main script
│── requirements.txt # Dependencies
│── README.md # Documentation
└── .gitignore # Git ignore file
This project is licensed under the MIT License – free to use and modify.