Skip to main content

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:

  1. Moves your mouse cursor slightly every 3 seconds
  2. Presses the shift key every 60 seconds (20 × 3s intervals)
  3. Monitors your real activity using mouse and keyboard listeners
  4. Pauses automatically when you move the mouse, click, scroll, or type
  5. 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)

Source distribution for stayactive 1.0.1
File Size Uploaded
stayactive-1.0.1.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stayactive 1.0.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page