Skip to main content

Keep computer awake by moving the mouse around

Project description

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

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

pycaffeine-1.0.0.tar.gz (45.8 kB view details)

Uploaded Source

Built Distribution

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

pycaffeine-1.0.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file pycaffeine-1.0.0.tar.gz.

File metadata

  • Download URL: pycaffeine-1.0.0.tar.gz
  • Upload date:
  • Size: 45.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pycaffeine-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9f16d070056a0580ec8faea430785d009a8b5311c1914ef8bc7292a53ebecce0
MD5 e40fe9dbb937c591a4e590f400665c0e
BLAKE2b-256 fe4fbf4b40765ea9c330409befdbd333da631be3758761aefe49573a6864d5a0

See more details on using hashes here.

File details

Details for the file pycaffeine-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pycaffeine-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pycaffeine-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 076acd2db312eaa0baa30399b3035a7cc44cbb9f5a24fcb3e2d74da70cc2d400
MD5 5a5ea8824e9e60824a59fe66d9a5095e
BLAKE2b-256 a5a48d1f9ba32461f692e48f69170bba3e2af75b9f2293684e8810b11b42c612

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