StayActive
A smart activity simulator utility that keeps your computer active while respecting your actual usage.
Features
- Smart Mouse Movement: Randomly moves cursor within configurable pixel ranges
- Periodic Key Presses: Sends shift key presses at intervals to prevent sleep
- User Activity Detection: Automatically pauses when you're actually using your computer
- Safety First: Monitors real mouse/keyboard input and gets out of your way
- Configurable: Adjustable intervals, movement ranges, and activity timeouts
Installation
pip install stayactive
Usage
Command Line
stayactive
Python Module
from stayactive import main
main()
How It Works
StayActive runs in the background and:
- Moves your mouse cursor slightly every 3 seconds
- Presses the shift key every 60 seconds (20 × 3s intervals)
- Monitors your real activity using mouse and keyboard listeners
- Pauses automatically when you move the mouse, click, scroll, or type
- Resumes after 5 seconds of inactivity
Safety Features
- 🔴 Auto-pause: Detects real user input and pauses immediately
- 🟢 Auto-resume: Waits for inactivity before resuming automation
- 🛡️ Non-intrusive: Never interferes with your actual work
Configuration
You can modify these constants in the source:
MOVE_INTERVAL_SECONDS = 3 # How often to move mouse
MIN_PIXELS_TO_MOVE = 1 # Minimum movement distance
MAX_PIXELS_TO_MOVE = 15 # Maximum movement distance
KEY_PRESS_INTERVAL = 20 # Shift key every N mouse moves
USER_ACTIVITY_TIMEOUT = 5 # Seconds to wait after user stops
Requirements
- Python 3.6+
- pyautogui
- pynput
License
MIT License - see LICENSE file for details.
Author
Rajdeep Banik (banik.rajdeep1056@gmail.com)
Metadata
Release files for stayactive 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| stayactive-1.0.1.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stayactive-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.9 kB
Release files / stayactive-1.0.1.tar.gz
| Download URL | stayactive-1.0.1.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe77be3be208a1798e9d5ad4e972577587312344216af4220c475ac90fdf961c
|
|
BLAKE2b-256 checksum How to use checksums |
23aa49c9ba10f3aec52e1b6451512b5bfb9b4340eb1fd01f5069354dd601e5d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / stayactive-1.0.1-py3-none-any.whl
| Download URL | stayactive-1.0.1-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef5efa1b48429fc59badfaaa66da032b664e8119a1c874d5c01a3aa1418ed32c
|
|
BLAKE2b-256 checksum How to use checksums |
dd2095a5d77e836f2011a06927532a796cc9c173ee17220725a192793b6cadfc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|