e-mouse for mundane tasks
Mouse-E is a lightweight Python script designed to simulate mouse activity on macOS. It prevents your computer from entering sleep or idle mode by moving the mouse slightly after a specified period of inactivity.
- Detects user inactivity using macOS
ioregcommand. - Moves the mouse slightly to simulate activity.
- Customizable idle time limit and frequency of movement.
- Python 3.6 or later
pyautoguilibrary- macOS environment
-
Clone the repository:
git clone https://github.com/your-username/mouse-e.git cd mouse-e -
Install the required Python library:
pip install pyautogui
-
Open the script in a text editor to customize the idle time limit (in seconds). The default is
10seconds:idle_time_limit = 10
-
Run the script:
python mouse-e.py
The script will monitor your system's idle time. If it exceeds the specified limit, the mouse will move slightly to prevent the system from registering inactivity.
- MacOS Only: This script uses the
ioregcommand to detect idle time, which is specific to macOS. - Permissions: Ensure you have the necessary permissions to execute the script and interact with system events.
- Modify the
idle_time_limitvariable to change the inactivity threshold. - Adjust the sleep intervals (
time.sleep(...)) for checking idle status or movement frequency.
Use this script responsibly. It is intended for personal use to prevent unintended screen locking or system sleep. Ensure compliance with your organization's IT policies if used in a work environment.