Pattern Specification
Patterns are template files with color placeholders that Gtheme fills with values from the selected theme. They live in {desktop}/gtheme/patterns/.
Example
Here’s a kitty terminal pattern:
<[output-file]>=~/.config/kitty/colors.conf# <[theme-name]> - Kitty colors (gtheme generated)
font_family <[default-font|GeistMono Nerd Font]>font_size <[default-font-size|11]>
cursor #<[cursor]>cursor_text_color #<[foreground]>
foreground #<[foreground]>background #<[background]>selection_foreground #<[selection-foreground]>selection_background #<[selection-background]>
# blackcolor0 #<[black]>color8 #<[black-hg]>
# redcolor1 #<[red]>color9 #<[red-hg]>
# greencolor2 #<[green]>color10 #<[green-hg]>
# yellowcolor3 #<[yellow]>color11 #<[yellow-hg]>
# bluecolor4 #<[blue]>color12 #<[blue-hg]>
# magentacolor5 #<[magenta]>color13 #<[magenta-hg]>
# cyancolor6 #<[cyan]>color14 #<[cyan-hg]>
# whitecolor7 #<[white]>color15 #<[white-hg]>Placeholder syntax
All placeholders use the format <[property]>. Gtheme replaces them with the corresponding value from the theme’s [colors] section or the user’s user_settings.toml.
<[output-file]>=<path>
Mandatory. Specifies where the filled pattern is written. Must be on its own line with nothing else.
<[output-file]>=~/.config/kitty/colors.conf<[color-name]>
Replaced with the hex color value from the theme (without # prefix). Add the prefix in your pattern as needed:
# With # prefixforeground #<[foreground]>
# With 0x prefixforeground: '0x<[foreground]>'
# With rgba() wrapper$primary = rgba(<[blue]>ff)<[property|fallback]>
Replaced with the value of a user setting from user_settings.toml. If the setting doesn’t exist, the fallback value is used:
font_family <[default-font|JetBrains Mono]>font_size <[default-font-size|12]><[theme-name]>
Replaced with the name field from the current theme file:
# <[theme-name]> - Generated by GthemeModules and sub-modules
If an application uses multiple config files, you can organize related patterns into a module — a directory inside patterns/:
patterns/├── kitty.pattern├── rofi.pattern└── spotify/ ├── spotify-colors.pattern └── spotify-theme.patternThe directory name becomes the module name (spotify). When a module is filled, all sub-patterns inside it are filled too. Enabling or disabling a module affects all its sub-patterns.
Pattern inversion
Some themes have wallpapers whose colors clash with text foreground colors, making text hard to read. Inverting a pattern swaps:
foreground↔backgroundselection-foreground↔selection-background
Toggle inversion with:
gtheme pattern invert <pattern>Inversion state is stored in desktop_config.json under the inverted key.