百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

Spell

> DevOps
开源

通过魔法的神奇艺术创建桌面小工具!!

189 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

通过魔法的神奇艺术创建桌面小工具!!

Spell

Make desktop widgets by the mystic arts of Spell !!

Report Bug · Request Feature · Wiki · Join Matrix · Showcase · Website

**Don't forget to star the project if you like it **

This preview is part of a WIP shell I made using Spell called Young Shell.

Spell is a framework that provides necessary tooling to create highly customisable, shells for your wayland compositors (like niri, hyprland) using Slint UI.

Here is a tutorial for new comers to get a hang of spell.

Rather then leveraging Gtk for widget creation.Spell leverages Slint, a 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.

Features ️

  1. Simple frontend with fast backend: As Spell uses Slint for creating widgets, which is extremely customisable while being easy to use. Backed by rust, the code remains lightweight, memory safe and predictable.
  2. Hot Reload: Once the size of widget is set. Changes in slint code is reflected as is in the widget. Leading to faster iterations of code.
  3. Streamline Project Structure: Spell doesn't change the project structure of slint in any way. So, no new paradigm needs to be learned for working with spell.
  4. Remote Accessibility: Spell ships a CLI through which state of widget can be made accessible, enabling integration in compositor settings.
  5. Prebuilt Components(Material, Vivi, Sleek, Surrealism): Spell's CLI can port slint's material components, surreal, sleek etc component libs to your project, Just add --material or --vivi etc when creating a starter project with sp.
  6. XDG Popups: The crate also provides methods to create and manage popups, these can be lend for smaller tasks and functionalities.
  7. Services: (WIP) Spell has a vault with common functionalities like app launcher backend, notification backend, MPRIS etc.

Minimal Example ✨

Let's first install the CLI of Spell.

# To install CLI
cargo install spell-cli

# To create a starter project
sp new project-name

sp CLI offers this clean way to create a project so you wouldn't have to hustle with the initial setup. Under the hood, it uses cargo new command paired with filling the files with appropriate content.

Now the main code, following code in you slint file create a counter and initialises it from default value of 42.

slint
// In path and file name `ui/app-window.slint`
import { VerticalBox, Button } from "std-widgets.slint";

export component AppWindow inherits Window {
    in-out property  counter: 42;
    callback request-increase-value();
    VerticalBox {
        Text {
            text: "Counter: \{root.counter}";
        }

        Button {
            text: "Increase value";
            clicked => {
                root.request-increase-value();
            }
        }
    }
}

Now, to increment the data and specify the dimensions of widget add the following to your src/main.rs file.

…

Running this code with cargo will display a widget in your wayland compositor.

It is important to mention that if you have defined width and height in both your window and in the rust code,then the renderer will manage the more or less dimensions accordingly, which may lead to undefined behaviour.

For details of arguments and use of [layer_properties::WindowConf] and [cast_spell], head to their respective attached docs. The frontend code for this example is adopted from./slint-rust-template

More Examples

You can clone this repository and run the following examples.

  1. Example of a simple bar.
bash
cargo run -p spell-demo --bin bar
  1. OSD from the tutorial blog can also be executed.
bash
cargo run -p spell-demo --bin osd
  1. In order to open a simple popup.
bash
cargo run -p spell-demo --bin popup

When can we expect a stable release?

I remember adding this section a few months ago, now I can say that the first stable version is out!!.Create a spell project and give it a shot.

Caution

[!WARNING] The crate is under active development and breaking changes are expected though rare at the moment.

  1. A year or so of bad design and programming decisions have come back to haunt me now, making, feature addition and further changes difficult. Hence, the project is under major restructuring to ease out the process for future development. Internal improvements that are to be done are mentioned in RESTRUCTURE.md file.
  2. Hide and show features of widgets work flawlessly in niri but hangs in hyprland due to an underlying bug.

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 for others to use and create widgets in rust.

Why Slint?

Slint because it is a simple yet powerful declarative lang that is extremely easy to learn (you can even get its sense in just few mins here). Secondly, unlike other UI toolkits, it has awesome integration for rust. A compatibility that is hard to find.

AI Policy

I think it is high time to add this section now to avoid any confusion. I want to make it clear that the project started for my own personal use. Hence, I don't have any constraints to deliver with fast release cycles. To maintain learning, I prefer to never write code from LLMs here. I also prefer that contribution be made by the person and not models.

I am not against the use of LLMs, it is just that I tend to avoid it in my side projects. Having some time to directly code without the prompt-wait-improve cycle is good.

Batteries

Not a lot of batteries included for now, future implementations of common functionalities will occur in vault module of this crate. For now it has a AppSelector, which can be used to retrieve app information for creating a launcher. Other 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 roadmap, view here.

  1. sysinfo: For System info like uptime, CPU, memory usage etc.
  2. rusty-network-manger: For network management.
  3. bluer: For bluetooth management.

Contributing

I encourage you to try it out, feel free to open issues and even better, PRs for issues. Feature requests can be posted in the issues section itself. Before posting make sure that the problem isn't already reported or present in ROADMAP. If you want to contribute, refer to CONTRIBUTE.md for project structure and code principles that are generally followed in writing spell.


Made with ♥️ and Vim.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustlinuxmadewithslintricingrust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理