Skip to content

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.

Notifications You must be signed in to change notification settings

roscodetech/mouse-mover-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 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

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

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages