A Windows 10/11 Widget Daemon
flora
provides a base for you to build any widget you want using HTML/CSS/JavaScript. flora
does
not provide any widgets for you, and it's up to you to either find widgets online or write your
own. This repo has some examples to get you started if you decide to make your own.
flora
is essentially a browser that displays your widgets. In fact, the window has an embedded
webview that uses Edge (Chromium) to display what is essentially webpages.
Warning
flora
is still rough around the edges. Though it does work, it still needs some convenience
features for a better user experience. Expect some issues to popup if you decide to use it.
- flora process
- A flora widget currently running on your computer.
- flora instance
- The current flora process. This is more of an internal term used by flora.
- flora handle
- The current window handle. Equivalent to the Windows HWND type. This is an internal term used by flora.
flora
has two main components:
- A process which handles displaying the widget
- A cli to interact with all
flora
processes running on your computer
Both of these components are bundled into a single binary. Starting a new flora
process begins
with the cli, where you specify the config and other options. These are then passed to the flora
instance (the current process) to take over and run the widget.
flora
is still in an early state, and as such must be compiled from source. To compile, you will
need Rust; you can find details about installing Rust here: https://www.rust-lang.org/tools/install
After cloning the repository, simply run:
cargo build
Or, if you want a release version:
cargo build --release
The compiled binary will be in the target/
directory.
If you want to run flora
directly:
cargo run
Otherwise, after compiling, you can run the binary directly (located in the target/
directory).
You will notice that the command will fail saying you need to specify a config. You can do so by running one of the following commands:
Cargo:
cargo run -- --config-path <PATH>
Or, if running the binary directly:
flora --config--path <PATH>
You can find configuration details below.
Note
This section briefly goes into configuration to quickly get you started. See the docs
for a more detailed rundown of every option you can configure with flora
.
flora
is configured using a <config_name>.flora
file. This can be located anywhere and named
anything as long as it has the .flora
extension.
The config file uses lisp-like syntax (S-expressions), and the configuration options are quite straightforward. A full list of options is specified in the docs.
A minimum configuration is the following:
((content "<div>hi<div>"))
Of course, this does not do anything particularly useful, but shows how easily you can get started with a widget. However, unless you have a very trivial widget, it's better to separate the actual content of the widget into a separate file. This can be done as follows:
((content "file:///absolute/path/to/file")
(content-url #t))
Then all you need to do is ensure the file is available at the path. Additionally, if you really wanted to, you could even set the content to any URL and the webpage will be rendered.
Though a standalone project, this repo is also a bit of exploratory work for
winbar (a Windows 10/11 status bar). winbar
may eventually
supersede this project, however, I believe there is value in keeping this project separate, and as
such, flora
will continue to be maintained for the foreseeable future.
- The webview2-rs crate was a big help in creating this project; it does a lot of the heavylifting to make this project possible.