Skip to main content

Keep Slack/Teams active by simulating key presses at regular intervals

Project description

lazy-b

Keep Slack, Microsoft Teams, or other similar applications from showing you as "away" or "inactive" by simulating key presses at regular intervals.

Installation

Install directly from PyPI using pip or uv:

# Using pip
pip install lazy-b

# Using uv
uv pip install lazy-b

# For macOS users (to enable dock icon hiding)
pip install "lazy-b[macos]"
# or with uv
uv pip install "lazy-b[macos]"

Usage

Command Line

Run lazy-b from the command line:

# Basic usage (will press Shift key every 1 second)
lazy-b

# Customize the interval (e.g., every 30 seconds)
lazy-b --interval 30

# Run in quiet mode (no console output)
lazy-b --quiet

# Run in foreground mode (shows dock icon - macOS only)
lazy-b --foreground

Platform-specific behavior

  • macOS: By default, runs in background mode with no dock icon. You can close the terminal window after starting it, and it will continue to run.
  • Windows/Linux: The application runs in the terminal window. You need to keep the window open for the program to continue running.

To stop lazy-b, you can:

  • Press Ctrl+C in the terminal window
  • On macOS, if running in background, find and kill the process:
# Find the process
ps aux | grep lazy-b

# Kill it using the PID
kill <PID>

Python API

You can also use the Python API directly in your own scripts (works on all platforms):

from lazy_b import LazyB
import time

# Create an instance with a custom interval (in seconds)
lazy = LazyB(interval=5)  # Press Shift every 5 seconds

# Define a callback function to handle status messages (optional)
def status_callback(message):
    print(f"Status: {message}")

# Start the simulation
lazy.start(callback=status_callback)

try:
    # Keep your script running
    while True:
        time.sleep(1)
except KeyboardInterrupt:
    # Stop on Ctrl+C
    lazy.stop()

Features

  • Prevents "away" or "inactive" status in messaging applications
  • Customizable interval between key presses (default: 1 second)
  • Simple command-line interface
  • Cross-platform: Works on macOS, Windows, and Linux
  • Background mode on macOS (no dock icon)
  • Python API for integration into your own scripts
  • Minimal resource usage

Development

Setup Development Environment

# Clone the repository
git clone https://github.com/Lanznx/lazy-b.git
cd lazy-b

# Setup development environment
make dev-setup

# Install in development mode
make install

Releasing New Versions

To release a new version:

# Update version, create commit and tag
make release  # This will prompt for the new version

# Push changes and tag to GitHub
git push origin main
git push origin v<version>  # e.g., git push origin v0.2.0

Pushing a tag will automatically trigger the release workflow, which will:

  1. Build the package
  2. Create a GitHub release
  3. Publish to PyPI

Requirements

  • Python 3.8 or higher
  • PyAutoGUI
  • PyObjC-Core (for macOS dock icon hiding, optional)

License

MIT

Disclaimer

This tool is meant for legitimate use cases like preventing timeouts during presentations or when you're actively reading but not typing. Please use responsibly and in accordance with your organization's policies.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lazy_b-0.1.7.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lazy_b-0.1.7-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file lazy_b-0.1.7.tar.gz.

File metadata

  • Download URL: lazy_b-0.1.7.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lazy_b-0.1.7.tar.gz
Algorithm Hash digest
SHA256 fc77078e54158f86c10a254974d86959d6a9c20bb5f6b1853e9f80a8c00bf251
MD5 cc19379a9187794e2908f4055d0a7601
BLAKE2b-256 7373e486f1297d8716bb9a11f66bb6bd4435e94870d9029e9e4bf48d1e5ee51e

See more details on using hashes here.

File details

Details for the file lazy_b-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: lazy_b-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lazy_b-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 bf539c5ccfde5068228db20d77416cb31f2ec342119bc89b85ddfad19ff03e12
MD5 b8ad7da3ee5b0f7b9f2ea5f4eab2870d
BLAKE2b-256 bf6a3bb4be395ef47f5ccd7515140ebf47a6d9b0b804024a00fafcc9b180777b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page