Skip to content

Configuration

ini edited this page Jan 14, 2024 · 21 revisions

Creating templates

Custom keywords

Example config:

[config.custom_keywords.font]
find = 'font1'
replace = 'Google Sans'

Usage in templates:

{{ custom.font1 }}

Keywords

Important

Since 1.0.0, you have to define the scheme and format instead of leaving both empty for default values.

  • Basic syntax: {{<key>}}
  • Colors: {{colors.<color>.<scheme>.<format>}}
  • Image: {{image}}
  • Custom: {{custom.<keyword>}}

Colors

matugen-keyword

A - All colors start with the {{colors. prefix

B - The color keyword from here

C - The scheme from here or default

D - The format from here

Example:

Tip

To get a list of all keywords you can use, run:

matugen color hex "#ffbf9b" --show-colors
{{colors.primary.default.hex}}
{{colors.primary.default.hex_stripped}}
{{colors.primary.default.rgb}}
{{colors.primary.default.rgba}}
{{colors.primary.default.hsl}}
{{colors.primary.default.hsla}}
{{colors.primary.default.red}}
{{colors.primary.default.green}}
{{colors.primary.default.blue}}
{{colors.primary.default.alpha}}
{{colors.primary.default.hue}}
{{colors.primary.default.saturation}}
{{colors.primary.default.lightness}}

{{colors.surface.light.hex}}
{{colors.surface.dark.hex}}
{{colors.surface.amoled.hex}}

You can get the source color (color used for generating colorscheme) by using:

{{colors.source_color.default.hex}};

Image

You can also get the image path (if it was provided) by using:

{{image}}

Custom

You can use your custom defined keywords from config by using:

{{<custom>.<keyword>}}

Example of all the formats:

  • hex
  • hex_stripped
  • rgb
  • rgba
  • hsl
  • hsla
  • red
  • green
  • blue
  • alpha
  • hue
  • saturation
  • lightness

Configuration

Here is a list of different locations for the configuration file:

  • Windows: C:\Users\user\AppData\Roaming\InioX\matugen\config\config.toml
  • Linux: /home/user/.config/matugen/config.toml
  • MacOS: /Users/user/Library/Application Support/com.InioX.matugen/config.toml

Tip

You can also use a custom configuration path by using the -c argument

Configuration items

Name Type Default Description
reload_apps bool false Whether to reload apps.
set_wallpaper bool false Whether to set the wallpaper (if true, requires wallpaper_tool to be set).
wallpaper_tool String None The wallpaper tool to use (Swwww, Swaybg, Feh, Nitrogen).
prefix String "@" The prefix to use (for example: @{primary})
reload_gtk_theme bool false Whether to reload the gtk theme. REMOVED, USE gtk_theme in config.reload_apps_list.
run_after Vec [] The commands to run after the templates have been generated. REMOVED, USE A WRAPPER FUNCTION FOR MATUGEN INSTEAD.
swww_options <Vec> [] The options to use for Swwww
feh_options <Vec> [] The options to use for Feh

Apps

Name Type Default Description
kitty bool true Whether to reload kitty.
waybar bool true Whether to reload waybar.
dunst bool true Whether to reload dunst.
gtk_theme bool true Whether to reload the GTK theme.

Example

# config_directory/config.toml
[config]
reload_apps = true
set_wallpaper = true
wallpaper_tool = 'Swww'
prefix = '@'
swww_options = [
    "--transition-type",
    "center",
]
run_after = [
    [ "echo", "'hello'" ],
    [ "echo", "'hello again'" ],
]

[config.reload_apps_list]
waybar = true
kitty = true
gtk_theme = true
dunst = true

Adding templates

Name Type Default Description
mode Option<Modes> Mode provided in args Which scheme to use for the template.
input_path PathBuf None Path to the template file.
output_path PathBuf None Path to export the template to.

Modes

Note

The mode key will override the mode specified in the arguments, only for that template.

For all available modes, look at the usage.

Example

# config_directory/config.toml

[templates.test] # First way of adding template
input_path = '~/.config/example/template.css'
output_path = '~/.config/example'
mode = "Light" # First letter MUST be upper-case

[templates] # Another way
test2 = { input_path = '~/.config/example/template2.css', output_path = '~/.config/example2' }
Clone this wiki locally