PimpMyRice

theme_dict

A theme_dict is the final, merged configuration dictionary generated when you apply a Theme. It contains all the colors, style, and module-specific settings that are passed to modules to actually apply your rice.


How to view the theme_dict

You can print the generated theme_dict for any theme application command by adding the --print-theme-dict flag:

pimp theme set THEME_NAME --print-theme-dict
pimp random --print-theme-dict
pimp refresh --print-theme-dict

This is handy for debugging and for understanding exactly what values are being passed to your modules.


Structure

A theme_dict contains fields from your palette, style, and theme, all merged together. Here's an example:

example theme_dict
         {
             'term': {
                 'color0': Color(#102f4c),
                 'color1': Color(#7fd2ff),
                 'color2': Color(#927fff),
                 'color3': Color(#ff7ffc),
                 'color4': Color(#ff7f92),
                 'color5': Color(#ffd47f),
                 'color6': Color(#bdff7f),
                 'color7': Color(#7fffa7),
                 'color8': Color(#3f6c96),
                 'color9': Color(#a0cde5),
                 'color10': Color(#a9a0e5),
                 'color11': Color(#e5a0e4),
                 'color12': Color(#e5a0aa),
                 'color13': Color(#e5cda0),
                 'color14': Color(#c3e5a0),
                 'color15': Color(#cce6ff)
             },
             'normal': {'bg': Color(#102f4c), 'fg': Color(#cce6ff)},
             'primary': {'bg': Color(#1d6d99), 'fg': Color(#000000)},
             'secondary': {'bg': Color(#153f66), 'fg': Color(#35a0ff)},
             'theme_name': 'tokyo',
             'wallpaper': Wallpaper(
                 path=PosixPath('/home/daddo/.config/pimpmyrice/themes/tokyo/4ur3tny7ka3e1.png'),
                 mode=<WallpaperMode.FILL: 'fill'>,
                 thumb=PosixPath('/home/daddo/.config/pimpmyrice/themes/tokyo/.4ur3tny7ka3e1_512.png')
             ),
             'mode': 'dark',
             'bar': {'bg': Color(#102f4c), 'fg': Color(#cce6ff)},
             'panel': {'bg': Color(#102f4c), 'fg': Color(#cce6ff)},
             'dialog': {'bg': Color(#102f4c), 'fg': Color(#cce6ff)},
             'input': {'bg': Color(#1d6d99), 'fg': Color(#000000)},
             'muted': {'bg': Color(#88b7e2), 'fg': Color(#141b21)},
             'accent': {'bg': Color(#1d6d99), 'fg': Color(#000000)},
             'destructive': {'bg': Color(#153f66), 'fg': Color(#35a0ff)},
             'border': {
                 'active': Color(#1d6d99),
                 'inactive': Color(#153d63),
                 'radius': 0,
                 'width': 4
             },
             'blur': {'enabled': True, 'passes': 3, 'strength': 7},
             'borders': {'outer': {'width': 0, 'color': Color(#102f4c)}},
             'font': {
                 'normal': {'family': 'DejaVu Sans', 'size': 12},
                 'mono': {'family': 'JetBrainsMono Nerd Font', 'size': 10}
             },
             'gaps': {'inner': 15, 'outer': 30},
             'opacity': {'active': 0.98, 'inactive': 0.95, 'terminal': 0.97},
             'padding': {'x': 25, 'y': 25},
             'shadow': {
                 'enabled': True,
                 'offset': 0,
                 'blur': 10,
                 'spread': 10,
                 'color': '0, 0, 0',
                 'opacity': 0.4
             },
             'titlebar': {
                 'enabled': False,
                 'active': {'bg': Color(#1d6d99), 'fg': Color(#000000)},
                 'inactive': {'bg': Color(#153d63), 'fg': Color(#000000)}
             },
             'animations': {'enabled': True, 'speed': 2, 'style': 'default'},
             'cursor': {'name': 'Adwaita', 'size': 24},
             'modules_styles': {
                 'waybar': {'variant': 'solid', 'colorful': 'no'},
                 'mpvpaper': {'video_wallpaper': ''},
                 'hyprland': {'blur_bg': False},
                 'betterdiscord': {'variant': 'standard'}
             }
         }

Common fields

  • term: 16 terminal colors (color0color15)
  • normal: main background/foreground
  • primary: main accent color
  • secondary: secondary accent color
  • theme_name: name of the applied theme
  • wallpaper: wallpaper info (path, mode, thumb)
  • mode: current mode (e.g. dark, light)
  • bar, panel, dialog, input, muted, accent, destructive: style blocks for UI elements
  • border, blur, font, gaps, opacity, padding, shadow, titlebar, animations, cursor: style settings
  • modules_styles: per-module overrides (see style docs)

The exact fields depend on your palette, style, and theme configuration.


Merge order

The theme_dict is generated by merging, in order (each step overrides the previous):

  1. Base Style: from PIMP_CONFIG_DIR/base_style.json
  2. Palette
  3. Theme style (from theme.json)
  4. Mode style (from theme.json)
  5. CLI styles: from PIMP_CONFIG_DIR/styles/STYLE_NAME via --style=STYLE1,STYLE2
  6. Module specific styles

Additionally, theme_name, wallpaper, and mode are always set at the top level.


How modules use theme_dict

When a module runs, it receives the theme_dict as input. This lets templates, shell commands, and Python hooks access all the merged color and style values. Module-specific overrides from modules_styles are automatically merged in for each module.


Tips & Tricks

  • Use --print-theme-dict to debug and see exactly what values are available.
  • You can reference any field in your module templates using Jinja, e.g. {{primary.bg}}, {{opacity.terminal}}.
  • If a value isn't what you expect, check the merge order above.
  • See the style, palette, and theme docs for more details on each section.

On this page