Skip to main content

pycaffeine
pycaffeine

Sponsor
Ko-fi Donate
Python PyQt6 uv Ruff
PyPi PyPI Downloads License: MIT
issues SonarCloud Coverage Quality Gate Status CI/CD Pipeline Build Status

Keep computer awake by moving the cursor by 1 pixel back and forth every few seconds

Table of Contents

Features

  • System tray application with start/stop controls
  • Native sleep/screensaver inhibition (D-Bus on Linux, SetThreadExecutionState on Windows, caffeinate on macOS)
  • Mouse simulation to also appear "Active" in chat apps (Teams/Slack)
  • Configurable interval (5s, 15s, 30s, 45s, 60s) from the tray menu
  • Cross-platform (Linux, Windows, macOS)
  • Standalone executable via PyInstaller

Usage

# Run from source
uv run python -m pycaffeine

Or download the latest standalone executable from Releases.

The app runs in the system tray. Right-click the tray icon to start, stop, change the interval, or quit.

Desktop Environment Notes (Linux)

Environment Tray icon Sleep inhibit Mouse simulation
KDE / XFCE / Cinnamon (X11 or Wayland) ✓ ✓ ✓ (Wayland needs XWayland 23.2+)
Ubuntu GNOME ✓ ✓ ✓
Vanilla GNOME (e.g. Fedora) needs AppIndicator extension ¹ ✓ ✓
  • ¹ GNOME tray icon: GNOME removed legacy tray support; install the AppIndicator extension / gnome-shell-extension-appindicator package (preinstalled on Ubuntu).
  • Mouse simulation on Wayland: requires XWayland 23.2+ with libei support (Plasma 6, GNOME 45+). Sleep inhibition works regardless.

Development and Testing

Requires UV to be installed.

Setup

uv lock --upgrade && uv sync --all-extras --all-groups

Running Unit Tests

poe test

Build

Build a standalone executable with PyInstaller:

poe build

The executable will be generated in the ./dist directory.

Other Tasks

poe linter

poe updatedev

License

Released under the MIT License

Support

If you find this project helpful, consider supporting development.

Sponsor on GitHub Buy Me a Coffee at ko-fi.com Donate via PayPal

Metadata

Release files for pycaffeine 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycaffeine 1.0.0
File Size Uploaded
pycaffeine-1.0.0.tar.gz 45.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pycaffeine 1.0.0
File Interpreter ABI Platform
pycaffeine-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 55.1 kB

Release files / pycaffeine-1.0.0.tar.gz

Download URL pycaffeine-1.0.0.tar.gz
Size 45.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9f16d070056a0580ec8faea430785d009a8b5311c1914ef8bc7292a53ebecce0
BLAKE2b-256 checksum
How to use checksums
fe4fbf4b40765ea9c330409befdbd333da631be3758761aefe49573a6864d5a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / pycaffeine-1.0.0-py3-none-any.whl

Download URL pycaffeine-1.0.0-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
076acd2db312eaa0baa30399b3035a7cc44cbb9f5a24fcb3e2d74da70cc2d400
BLAKE2b-256 checksum
How to use checksums
a5a48d1f9ba32461f692e48f69170bba3e2af75b9f2293684e8810b11b42c612
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

1.0.0 This release

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