A lightweight, feature rich Wayland idle manager written in Rust
A lightweight, feature rich Wayland idle manager written in Rust
Stasis
A modern Wayland idle manager that knows when to step back.
Keep your session balanced by preventing idle when you are busy and letting it happen when you are not.
Features • Installation • Quick Start • Architecture • CLI Usage • Compositor Support • Contributing
Stasis is not a simple timer-based screen locker.
It is a context-aware, event-driven idle manager built around explicit state and decisions.
Stasis is built around a deterministic, event-driven state machine.
There are no hidden timers, background polling loops, or implicit behavior.
External signals
↓
Event (pure data)
↓
Manager (decision logic)
↓
State (authoritative)
↓
Actions (declarative)
↓
Services (side effects)Design principles:
yay -S stasis
yay -S stasis-gitnix build 'github:saltnpepper97/stasis#stasis'swaylock PAM configuration
If you use swaylock as your screen locker on NixOS, you must add the following to your NixOS configuration or swaylock will lock the screen but never accept your password to unlock it:
security.pam.services.swaylock = {};Dependencies:
enable_dbus_inhibit)pactl)Build & install:
git clone https://github.com/saltnpepper97/stasis
cd stasis
cargo build --release --locked
sudo install -Dm755 target/release/stasis /usr/local/bin/stasis
sudo install -Dm644 assets/stasis.png /usr/local/share/icons/hicolor/256x256/apps/stasis.pngStart the daemon:
stasisThe full quick-start guide, configuration reference, and integration examples are available at https://saltnpepper97.github.io/stasis-site/.
Stasis automatically chooses the strongest lock-state source available:
LockedHint takes authority for that lock episode and is
followed until the real unlock. This supports service-backed lockers such as
Veila without locker-specific configuration.LockedHint
cannot expose a reliable unlock state and should be run in the foreground.login1 Lock and Unlock signals are requests rather than completed state.
enable_loginctl_integration therefore controls optional login1 sleep/wake
integration, not the lock-tracking method. LockedHint monitoring is automatic
through the login1 interface provided by systemd-logind and eLogind.
[!IMPORTANT] D-Bus session startup is required for full D-Bus features. If you want
enable_dbus_inhibitand other session-bus driven behavior to work reliably, start your compositor within a real D-Bus session (for exampleniri-session,dbus-run-session, or your compositor/distribution's recommended session launcher). If the compositor is not running in a proper session, inhibit monitoring may not activate.
Stasis supports inhibit messages from session D-Bus, including:
org.freedesktop.ScreenSaver Inhibit / UnInhibitorg.gnome.SessionManager Inhibit / Uninhibitorg.freedesktop.portal.Inhibit (Inhibit / CreateMonitor) with release via org.freedesktop.portal.Request.CloseOn the system bus, Stasis also polls login1 ListInhibitors for blocking
idle entries. These are authoritative lifetime-scoped holds (for example,
Codex holds one only while a turn is active). Stasis maps them to suspend-only
policy: lock, DPMS, and other earlier plan steps continue, while automatic
suspend waits until the inhibitor disappears.
Config key:
enable_dbus_inhibit true|false (default true)Use this when you want Stasis to honor session-bus inhibit requests from browsers, Steam, and portal clients, plus login1 blocking idle inhibitors.
Important separation:
enable_dbus_inhibit covers browser/app inhibit traffic from session D-Bus and blocking login1 idle inhibitors from the system bus.monitor_media is only for non-browser media/audio state.monitor_media; it is handled by D-Bus inhibit monitoring.To let the display turn off without automatically suspending:
default:
monitor_media true
suspend_inhibit_media ["spotify" "mpd"]
suspend_inhibit_apps ["handbrake"]
endsuspend_inhibit_apps and suspend_inhibit_media block only the automatic
suspend step. Monitored media that does not match suspend_inhibit_media keeps
the historical behavior and pauses the full idle plan. Media blacklist and
remote-player filters are applied first. When a suspend-only inhibitor clears,
Stasis resumes the remaining suspend timeout; manual stasis trigger suspend
still runs immediately.
stasis info [--json]
stasis blame [--json]
stasis watch
stasis tray
stasis pause [for | until ]
stasis resume
stasis toggle-inhibit
stasis trigger
stasis list actions
stasis list profiles
stasis profile
stasis report [today|week]
stasis reload
stasis stopstasis blame explains why an idle action is held. It names active
manual/system pauses, matched applications and media, suspend-only blockers,
live D-Bus inhibit cookies or portal request handles, and login1 idle holds.
The --json form is a versioned snapshot for scripts. Active login1 idle holds
are also included structurally in stasis info --json.
stasis tray runs an optional StatusNotifier tray frontend. It does not replace
stasis info --json; Waybar and other status bars can keep using the JSON output
directly. Tray users should run both the daemon and tray frontend, for example
with stasis.service plus the optional stasis-tray.service.
The tray requires a StatusNotifier tray host, such as Waybar's tray module, KDE Plasma, or another panel. The daemon remains headless and does not launch the tray automatically.
stasis watch writes one JSON object immediately, then another only when the
shell-facing state changes. This is intended for Quickshell and other shells
that need to react to Stasis without polling:
{"state":"manual","paused":true,"manually_paused":true,"profile":"work"}state is one of waiting, active, inhibited, locked, or manual.
The command stays connected until Stasis stops; each object is one line, so a
long-running process can parse the stream incrementally.
Quickshell can consume it with one long-running process:
import Quickshell.Io
Process {
running: true
command: ["stasis", "watch"]
stdout: SplitParser {
onRead: message => root.stasis = JSON.parse(message)
}
}Stasis integrates with each compositor's available IPC and standard Wayland protocols.
| Compositor | Support Status | Notes |
|---|---|---|
| Halley | ✅ Full Support | Native IPC via halleyctl; matches window app_id |
| Niri | ✅ Full Support | Tested and working perfectly |
| Hyprland | ✅ Full Support | Native IPC integration |
| labwc | ⚠️ Limited | Process-based fallback |
| River | ⚠️ Limited | Process-based fallback |
| Your Favorite | PRs Welcome | Help us expand support |
When running inside a Halley session, Stasis uses halleyctl node list --json
for app-inhibit tracking. inhibit_apps and suspend_inhibit_apps patterns
match Halley window app_id values, such as firefox, kitty, or
steam_app_123.
These compositors have IPC limitations that affect window enumeration.
Thank you for helping improve Stasis!
Guidelines:
If you find this project useful, consider sponsoring its development.
GitHub Sponsors helps ensure continued maintenance, faster bug fixes, and long-term improvements.
➡ https://github.com/sponsors/saltnpepper97
Released under the GPL-3.0 License.
Built with ❤️ for the Wayland community
Keeping your session in perfect balance between active and idle
No open issues yet, or sync has not completed.