Spell
Spell is a framework that provides necessary tooling to create highly customisable, shells for your wayland compositors (like hyprland) using Slint UI.
Rather then leveraging Gtk for widget creation, Slint declarative language provides a very easy but comprehensive way to make aesthetic interfaces. It, supports rust as backend, so as though there are not many batteries (for now) included in the framework itself, everything can be brought to life from the dark arts of rust.
When can we expect a stable release?
No promises but I think I can push it to a stable release (i.e. 1.0.0) in 2-3 months. You can find change logs for both spell-framework and CLI in CHANGELOG.
Inspiration
The project started as a personal repo for my own use. There is lack of widget creating tools in rust. Secondly, I had a question:
How the heck wayland works?
So, to understand wayland and side-by-side create a client gave birth to Spell. I know a lot more about functioning of wayland than I did. Also, a framework developed that could be delivered in some time for others to use and create widgets in rust.
Installation and Usage
[!WARNING] The crate is under active development and breaking changes are expected.
I have released a version in crates.io . Hence, you can simply add spell by command, cargo add spell-framework
.
Why Slint?
Slint because it is a simple yet powerful declarative lang that is extremely easy to learn (you can even get a sense in just few mins here). Secondly, unlike other good UI kits, it just has awesome integration for rust. A compatibility that is hard to find.
Todos
A lot of things are left to be done, but following core things are not implemented yet which might cause problem for widget creation.
- Resize of buffers aren't possible.
- It is irrelevant to define
Width
andHeight
of Window, as that should be provided directly in yourmain
function. (Though, I must say that recommended way of creating windows with curved borders is to place aRectangle
in a transparent window and then define itsborder_radius
.)
Having said that,you should try creating static widgets (like showing clock, day etc) at
this point with spell
and see how that turns out.
Minimal Example
I am creating my own shell from spell, which is currently private and will soon be shown
on display as spell becomes more mature. As for producing a minimal example, you can clone
slint-rust-template and change the name to your preferred name ( don't forget to modify Cargo.toml
).Then add spell in dependencies
from this github link along with the following patches in the bottom.
[]
= { = "https://github.com/slint-ui/slint" }
= { = "https://github.com/slint-ui/slint" }
= { = "https://github.com/slint-ui/slint" }
= { = "https://github.com/slint-ui/slint" }
and then replace the main.rs
with following contents:
use ;
use ComponentHandle;
use ;
include_modules!;
Batteries
No batteries, but common functionalities like system tray, temp etc, will be added later for convenience. I recommend the use of following crates for some basic usage, though you must note that I haven't used them extensively myself (for now).
- sysinfo: For System info like uptime, cpu, memory usage etc.
- rusty-network-manger: For network management.
- bluer: For bluetooth management.
Docs
Docs can be found here.
Contributing
I should say that at this point, the crate is not ready for contributions but people can open issues for suggestions. Bugs and feature-requests will be ignored for now. As soon as a stable release happens, I will restructure my workflow for issues and PR.