Description
Matugen is a cross-platform tool that generates a colorscheme either from an image or a color, and exports it to a file from a template. It can also set the wallpaper if one was provided.
About Material Design 3
Material Design 3 offers a new color system that allows for more flexible and dynamic use of color. The new system includes a wider range of colors, as well as a range of tints and shades that can be used to create subtle variations in color.
Other projects
Supported platforms
- Windows
- Linux
- MacOS
- NetBSD
Warning Matugen only supports setting the wallpaper and restarting apps on Linux and NetBSD for now.
Roadmap
- Add GTK4 UI
- Add a light/dark/amoled option for each template
- Support more color formats for generating colorscheme
- Rgba
- Rgb
- Hsl
- Suport changing the wallpaper on different platforms
- MacOS
- Windows
- Support changing the wallpaper on X11
- Feh
- Nitrogen
Note Want a feature that is not listed above? Simply open an issue.
Installation
Cargo
cargo install matugen
NixOS
Add matugen to your flake inputs:
inputs = {
matugen = {
url = "github:/InioX/Matugen";
};
# ...
};
Then you can add it to your packages:
let
system = "x86_64-linux";
in {
environment.systemPackages = with pkgs; [
# ...
inputs.matugen.packages.${system}.default
];
}
NetBSD
pkgin install matugen
or, if you prefer to build it from source
cd /usr/pkgsrc/graphics/matugen
make install
Usage
Modes
Palettes
Help
Show colors
Verbose mode
Generate from an image
# Dark mode
# Light mode
# AMOLED/"pure dark" mode
Example:
Generate from a color
# Dark mode
# Light mode
# AMOLED/"pure dark" mode
Example:
Creating templates
The basic syntax for using colors is prefix + {color} (The default prefix is @, so the usage would be @{color}).
Keywords
@@}; /* Result: #ffb783 */
@@}; /* Result: #ffb783 */
@@}; /* Result: rgb(255, 183, 131) */
@@}; /* Result: rgba(255, 183, 131, 255) */
@@}; /* Result: ffb783 */
You can get the source color (color used for generating colorscheme) by using:
You can also get the image (if it was provided) by using:
Note If no image was provided, Matugen will just skip over the image keyword
Example of all the color keywords:
/*colors.css*/
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
@@};
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
Note You can also use a custom configuration path by using the
-cargument
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}) |
gtk_theme in config.reload_apps_list. |
|||
| run_after | Vec | [] | The commands to run after the templates have been generated. |
| 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
[]
= true
= true
= 'Swww'
= '@'
= [
"--transition-type",
"center",
]
= [
[ "echo", "'hello'" ],
[ "echo", "'hello again'" ],
]
[]
= true
= true
= true
= 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
modekey 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
[] # First way of adding template
= '~/.config/example/template.css'
= '~/.config/example'
= "Light" # First letter MUST be upper-case
[] # Another way
= { = '~/.config/example/template2.css', = '~/.config/example2' }