pycaffeine
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-appindicatorpackage (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.
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pycaffeine-1.0.0.tar.gz | 45.8 kB | Without provenance | Details for pycaffeine-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pycaffeine-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for pycaffeine-1.0.0-py3-none-any.whl |
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
|
Security for pycaffeine 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.