Theme Templates
Rong uses Go’s text/template to render themes from Material colors. Go's templates provide simple yet powerful syntax to generate templates.
Built-in
Rong has big enough list of built-in templates for various. After generating colors, rong
will execute these templates and put them in $XDG_STATE_DIR/rong/
(usually ~/.local/state/rong/
). Run:
ls ~/.local/state/rong/
This command will show list of generate theme file ready to be used in your desired applications. To automatically copy/link these theme files to any desired location, check out links in configuration files
Custom Templates
Built-in templates might not cover all use cases, so you can define your own using Go’s text/template
syntax. You can learn more about Go templates from the official docs or here.
Templates are rendered using a data structure called the execution context. You can learn about Rong’s execution context here.
Once you're familiar with the template syntax and execution context, follow these steps:
Create a file
Save it in the
rong
templates directory:$XDG_CONFIG_HOME/rong/templates/
(usually~/.config/rong/templates/
) File extension must be.tmpl
Example:~/.config/rong/templates/mytemplate.tmpl
Write the template
Use Go template syntax. Save the file.
Generate the theme
Run
rong <image|video>
Output will be in$XDG_STATE_HOME/rong/
(usually~/.local/state/rong/
) The output file will match your template filename, e.g.,mytemplate
Link it
Add an entry in
config.toml
to link the theme to your desired location. More info: Configuration.