A native KDE Plasma 6 widget that prevents your system from sleeping or blanking the screen — like GNOME's Caffeine extension, but built for Plasma with systemd-inhibit.
No Python. No tray hacks. No X11 dependencies. Fully Wayland-native.
- ☕ Click-to-toggle — left-click the coffee cup icon to inhibit/resume system sleep
- ⏱️ Countdown timers — right-click for timed activation (5 min, 15 min, 30 min, 1 hour, 2 hours)
- 🔄 Auto-inhibit apps — configure apps (e.g.
vlc,mpv,steam) that automatically activate Caffeine when running - 🚫 Manual override — temporarily force-deactivate Caffeine even when an auto-inhibit app is running by clicking the cup. It resumes auto-inhibition once the app is closed.
- 🔒 Lock-screen pause — automatically pauses inhibit when you lock your screen so monitors can still sleep, resumes on unlock
- 🌙 Keep awake while locked (optional) — let the screens turn off on lock but keep the system from suspending, e.g. for long file transfers
- 🎨 Theme-adaptive icons — symbolic SVG icons that match your Plasma color scheme (light & dark)
- 🔔 Desktop notifications — get notified when Caffeine activates or deactivates
- ⚙️ systemd-native — uses
systemd-inhibitdirectly, no deprecated APIs
┌──────────────────────────────────────────────────┐
│ Panel: [☕] ← Coffee cup icon (theme-colored) │
│ │
│ Left-click → Toggle caffeine on/off │
│ Right-click → Timer menu (5m / 15m / ... / ∞) │
│ │
│ Widget Settings → Configure auto-inhibit apps │
└──────────────────────────────────────────────────┘
| State | Icon | Description |
|---|---|---|
| OFF | Empty cup | System sleep enabled |
| ON | Steaming cup | System sleep inhibited |
| Paused | Steaming cup (dimmed) | Screen locked, inhibit temporarily paused |
main.qml (Plasma widget UI)
│
├── caffeine-toggle.sh — Toggles manual state on/off
├── caffeine-status.sh — Polls state, manages systemd-inhibit process
└── caffeine-lock-listener.sh — Monitors screen lock via D-Bus
- caffeine-toggle.sh creates/removes a state file to track manual activation
- caffeine-status.sh checks manual state + running apps, starts/stops
systemd-inhibitaccordingly - caffeine-lock-listener.sh watches
org.freedesktop.ScreenSaver.ActiveChangedto pause/resume on lock - The QML widget polls
caffeine-status.shevery 5 seconds and updates the icon
git clone https://github.com/tesla/plasma-systemd-caffeine.git
cd plasma-systemd-caffeine
./install.shThe installer:
- Installs helper scripts to
~/.local/bin/ - Installs the Plasma widget via
kpackagetool6 - Provides instructions to add the widget to your panel
- Right-click your panel → Add Widgets... (or Edit Mode → Add Widgets)
- Search for "Caffeine (systemd)" and drag it into your panel
- Click the coffee cup icon to toggle!
If the widget doesn't appear in the widget list:
systemctl --user restart plasma-plasmashell.service./uninstall.shThis removes the widget, all helper scripts, config files, and runtime state.
Right-click the widget in your panel → Configure Caffeine (systemd)...
Enter space-separated process names. Caffeine will automatically activate when any of these processes is running:
vlc mpv steam obs
Tip: Use
pgrep -l <name>to find the exact process name of an application.
Toggle "Use bundled Caffeine icons instead of system theme icons" to choose between:
- Disabled (Default): Uses the icons provided by your current active system/panel icon theme (e.g.
Kora,Breeze). - Enabled: Forces the use of the original, bundled GNOME Caffeine coffee cup icons.
Toggle "Keep system awake while screen is locked" to choose what happens when you lock the screen while Caffeine is active:
- Disabled (Default): The inhibit is paused. Screens turn off and the system may suspend according to your power settings.
- Enabled: The
idleinhibit is swapped for asleepinhibit until you unlock. Screens may still turn off, but the system will not suspend.
- KDE Plasma 6 (Wayland or X11)
systemd(forsystemd-inhibit)dbus-monitor(for screen lock detection, usually pre-installed)notify-send(for desktop notifications, usually pre-installed)
GPL-2.0-or-later
The coffee cup icons are derived from the GNOME Caffeine extension (GPLv2).