PimpMyRice

Style

A style defines the look and feel of your desktop environment—covering gaps, borders, fonts, opacity, shadows, and more. Styles are applied on top of your palette and can be customized globally, per-theme, per-mode, or even per-module.

Styles are JSON files, and you can edit or create them to fine-tune your setup. See below for details on each type of style and how they interact.


Base style

The base style is the foundation for all themes. It lives in PIMP_CONFIG_DIR/base_style.json and provides default values for all style fields. When you apply a theme, the base style is loaded first, and everything else builds on top of it.

PIMP_CONFIG_DIR/base_style.json
{
    "bar": {
        "bg": "{{panel.bg}}",
        "fg": "{{panel.fg}}"
    },
    "panel": {
        "bg": "{{normal.bg}}",
        "fg": "{{normal.bg.contrasting().adjusted(max_sat=20)}}"
    },
    "dialog": {
        "bg": "{{normal.bg}}",
        "fg": "{{normal.bg.contrasting().adjusted(max_sat=20)}}"
    },
    "input": {
        "bg": "{{primary.bg}}",
        "fg": "{{primary.bg.contrasting()}}"
    },
    "muted": {
        "bg": "{{normal.bg.adjusted(max_sat=40, val=('+60'if 'dark' in mode else '-40'))}}",
        "fg": "{{normal.bg.adjusted(max_sat=40, val=('+60'if 'dark' in mode else '-40')).contrasting()}}"
    },
    "accent": {
        "bg": "{{primary.bg}}",
        "fg": "{{primary.bg.contrasting()}}"
    },
    "destructive": {
        "bg": "{{secondary.bg}}",
        "fg": "{{secondary.bg.contrasting()}}"
    },
    "border": {
        "active": "{{primary.bg}}",
        "inactive": "{{normal.bg.adjusted(val='+10')}}",
        "radius": 15,
        "width": 4
    },
    "blur": {
        "enabled": true,
        "passes": 3,
        "strength": 7
    },
    "font": {
        "normal": {
            "family": "DejaVu Sans",
            "size": 12
        },
        "mono": {
            "family": "JetBrainsMono Nerd Font",
            "size": 10
        }
    },
    "gaps": {
        "inner": 10,
        "outer": 20
    },
    "opacity": {
        "active": 0.98,
        "inactive": 0.95,
        "terminal": 0.97
    },
    "padding": {
        "x": 10,
        "y": 10
    },
    "shadow": {
        "enabled": true,
        "offset": 0,
        "blur": 10,
        "spread": 10,
        "color": "0, 0, 0",
        "opacity": 0.4
    },
    "titlebar": {
        "enabled": false,
        "active": {
            "bg": "{{border.active}}",
            "fg": "{{primary.fg}}"
        },
        "inactive": {
            "bg": "{{border.inactive}}",
            "fg": "{{primary.fg}}"
        }
    },
    "animations": {
        "enabled": true,
        "speed": 2,
        "style": "default"
    },
    "cursor": {
        "name": "Adwaita",
        "size": 24
    },
    "modules_styles": {}
}

You can edit this file directly with:

pimp style edit

Global styles

A global style is a reusable style preset stored in PIMP_CONFIG_DIR/styles/. You can create your own or use the built-in ones. Global styles can be applied on top of the base style by passing the --style=STYLE_NAME flag to any pimp command that applies a theme.

Example:

sample_style.json
{
    "gaps": {
        "inner": 0,
        "outer": 0
    },
    "border": {
        "radius": 0,
        "width": 2
    },
    "opacity": {
        "active": 0.98,
        "inactive": 0.95
    },
    "shadow": {
        "enabled": false
    },
    "modules_styles": {
        "waybar": {
            "variant": "split",
            "colorful": "foreground"
        }
    }
}

To edit or create a global style:

pimp style edit STYLE_NAME

How styles are applied

Here's how styles are applied when you use a theme (each step overrides the previous):

  1. Base style (base_style.json)
  2. Palette
  3. Theme style (from theme.json)
  4. Mode style (from theme.json)
  5. Global styles (from styles/, via --style flag)
  6. Module-specific styles (see below)

See theme_dict for the final result.


Module-specific styles

You can target styles to specific modules using the modules_styles field. This is a dictionary where each key is a module name, and the value is a style dictionary that will be merged into the theme_dict for that module only.

Example:

"modules_styles": {
    "waybar": { "variant": "split", "colorful": "foreground" },
    "alacritty": { "opacity": 0.95 }
}

This lets you fine-tune the appearance of each module independently.


Tips & Tricks

  • Use Jinja-style references (e.g. {{primary.bg}}) to refer to palette or other style values.
  • You can use expressions like .contrasting() or .adjusted() for dynamic color adjustments.
  • All style fields are optional—only specify what you want to override.
  • See theme_dict for a full example of the merged result.

On this page