Cosmolith is a Rust daemon that watches COSMIC configuration changes and applies | saves them live to the running Wayland compositor via IPC calls. It translates COSMIC settings into compositor-specific IPC commands so changes take effect immediately without restarting your session.
Cosmolith is structured as a pipeline that listens to COSMIC configuration changes, normalizes them into typed events, and dispatches them to compositor backends.
- Watcher: Subscribes to COSMIC namespaces (for example,
com.system76.*) and receives raw configuration changes. Each watcher is responsible for a domain (input, keybindings, workspaces, etc.) and produces typed diffs instead of compositor-specific commands. - Event: A unified event model that represents all COSMIC changes (input, keybindings, workspace changes, window rules, and more). Each event is a typed payload that describes what changed, independent of any compositor.
- Dispatcher: Routes events to the active compositor and ensures only supported events are applied. It is the boundary where generic events become compositor actions.
- Compositor Layer: Defines the
Compositortrait and a set of event-specific traits. Backends implement these traits to translate events into compositor-specific IPC commands.
Compositor identification is done in identifier.rs and the result is used to initialize the appropriate backend in the compositor module. If the active compositor implements the relevant event-specific trait, the corresponding apply method is invoked.
The following architecture is chosen not for extreme optimality but for modularity in use. This makes the following work compositor independent & integrable/reusable ( By just sending Event struct & intializing the reactor)
- Rust (edition 2024)
- A COSMIC session with
cosmic-configavailable - Supported compositor (currently Hyprland)
cargo buildcargo runCosmolith will print detected compositor information and apply updates as configuration changes are observed.
- Fork the repository.
- Create a feature branch.
- Make changes with focused commits.
- Open a pull request describing the change and rationale.
MIT LICENSE