Crates.io | luthien-templates |
lib.rs | luthien-templates |
version | 0.1.0 |
source | src |
created_at | 2021-05-18 04:18:08.176205 |
updated_at | 2021-05-18 04:18:08.176205 |
description | Luthien plugin which renders Handlebars templates. |
homepage | |
repository | |
max_upload_size | |
id | 398841 |
size | 26,516 |
luthien-templates
renders user-defined Handlebars templates with Luthien theme data.
Install using Cargo from Crates.io:
cargo install luthien-templates
Add a plugin to your Luthien config:
[[plugins]]
executable = "~/.cargo/bin/luthien-templates"
Mustach templates in the plugin's config directory (should be something like ~/.config/luthien/plugins/templates
) will be rendered using the theme data.
The data accessible to the template looks like this (in some TypeScript-like pseudocode):
type Color = {
hex: string;
hex_stripped: string;
red: number;
green: number;
blue: number;
};
// The RGB channels are sRGB floating-point values from 0 to 1
type Data = {
wallpaper: string;
colors: {
palette: {
black: Color;
red: Color;
green: Color;
yellow: Color;
blue: Color;
purple: Color;
cyan: Color;
white: Color;
};
accents: Color[];
foreground: Color;
background: Color;
};
};
colors.accents
is a list of accent colors in descending order of importance, so low-indexed colors should be used more often. There should be at least 6 accents.
The rendered template is then copied into a file in the output directory (should be something like ~/.local/share/luthien/outputs/plugins/templates
on Unix-like systems).