Keep computer awake by moving the mouse around
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f16d070056a0580ec8faea430785d009a8b5311c1914ef8bc7292a53ebecce0
|
|
| MD5 |
e40fe9dbb937c591a4e590f400665c0e
|
|
| BLAKE2b-256 |
fe4fbf4b40765ea9c330409befdbd333da631be3758761aefe49573a6864d5a0
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
076acd2db312eaa0baa30399b3035a7cc44cbb9f5a24fcb3e2d74da70cc2d400
|
|
| MD5 |
5a5ea8824e9e60824a59fe66d9a5095e
|
|
| BLAKE2b-256 |
a5a48d1f9ba32461f692e48f69170bba3e2af75b9f2293684e8810b11b42c612
|