DankMaterialShell icon indicating copy to clipboard operation
DankMaterialShell copied to clipboard

Matugen import json support for custom keywords

Open TowelSniffer opened this issue 2 months ago • 2 comments

The last version of matugen allows you to import json with --import-json <json file> for setting custom keywords. I think this would be a nice option for controlling things like transparency.

TowelSniffer avatar Nov 04 '25 13:11 TowelSniffer

Could you elaborate more on the use case, I dont fully get it - like what you'd want it for or how to integrate it.

bbedward avatar Nov 04 '25 20:11 bbedward

Hi sorry for the lack of clarity.

It's more just helpful to have a JSON that allows for setting things like custom colours, or values. I find my main use case is for using matugen with various css files. Having a central place to define components that you are reusing is great.

For example with transparency, It's nice to have a central place to define alpha hex values. Then if you wish to modify the level of transparency in the future you can just change your defaults here instead of having to search through all your template files. for example light backgrounds seem to appear more opaque with the same alpha value.

"alpha": {
    "dark": "E6",
    "light": "d9",
    ...
}

then I can use these pre defined values in things like better discord, or my custom anki css overwrites, or zen browser like:

--bg-3: {{colors.surface_container_low.default.hex}}d9;
--bg-3: {{colors.surface_container_low.default.hex}}{{alpha.dark}};

Earlier versions of matugen allowed you to define string values in your config with the following, but it's no longer supported in favor of --import-json:

[config.custom_keywords]
font1 = "Google Sans"

As far as integration, maybe a something like a userValues.json within ~/.config/matugen/dms with can be imported if it exists. It seems this is already exists for overwriting default templates. Or a way to add custom user flags to the matugen command.

Edit: Being able to define custom color pallets for things like code editors is also nice. You can do this currently in your config but the ability to categorize them is json format is better and it seems to be the way matugen is heading also.

TowelSniffer avatar Nov 05 '25 10:11 TowelSniffer