No description
  • Python 82.2%
  • Shell 17.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-23 19:35:12 +02:00
.vscode add python config for vscode 2026-08-03 12:34:57 +02:00
patches allow prove to use full bed while tramming 2026-08-05 14:06:38 +02:00
settings-reports add tuned report for reference 2026-08-01 13:59:53 +02:00
.gitignore add gitignore 2026-07-30 10:56:06 +02:00
apply_config_customizations.py allow adding options 2026-08-21 13:34:10 +02:00
customizations.yaml override default mesh max to use the full bed 2026-08-23 19:35:12 +02:00
example.json allow copying reference config 2026-07-30 10:53:50 +02:00
example.yaml allow copying reference config 2026-07-30 10:53:50 +02:00
README.md add environment to _meta 2026-07-30 14:59:41 +02:00
rebase_and_reapply.sh add environment to _meta 2026-07-30 14:59:41 +02:00

Marlin Config Customizer

This folder is intentionally self-contained so it can be moved into a separate repository later.

Files

  • apply_config_customizations.py: generic rule engine that edits Marlin config files.
  • customizations.yaml: your printer-specific customization map.

Why this structure

  • Marlin release updates often shuffle comments and sections.
  • Reapplying a fixed list of symbol edits is faster and safer than manual merge edits.
  • Warnings help catch upstream renames or removed symbols.

Map format

Top-level keys are file paths relative to repo root. Each key contains a list of rules.

Optional top-level metadata keys:

  • board or _meta.board: board path under Configurations/config/examples, for example Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 2.0.
  • environment or _meta.environment: PlatformIO environment for the final build hint.

Rule fields:

  • symbol (required): C preprocessor define symbol.
  • action (required): enable, disable, or set.
  • value (required for set): replacement value right side of define.
  • note (optional): rationale shown in verbose mode.

Reference Config Copy

You can copy a board reference config from the Marlin Configurations repository before applying custom rules.

  • Default Configurations repo path is ../Configurations relative to this script.
  • Default Marlin target repo path remains ../Marlin.
  • Files copied to the target Marlin tree: Marlin/Configuration.h, Marlin/Configuration_adv.h, Marlin/_Bootscreen.h, Marlin/_Statusscreen.h.

Set board in your map file (board or _meta.board) and run:

python3 apply_config_customizations.py --copy-reference-config --dry-run
python3 apply_config_customizations.py --copy-reference-config

When --copy-reference-config --dry-run is used, the script automatically prints a unified diff between your current Marlin files and the selected board reference files.

Or override board and paths from CLI:

python3 apply_config_customizations.py \
  --copy-reference-config \
  --board "Creality/Ender-3 Pro/BigTreeTech SKR Mini E3 2.0" \
  --config-repo-root ../Configurations \
  --repo-root ../Marlin \
  --dry-run

Usage

Run from this customizer repository root:

python3 apply_config_customizations.py --dry-run
python3 apply_config_customizations.py

To reset local changes and align sources before re-applying customizations:

  • Marlin: checkout latest stable release tag (no beta/rc/alpha/dev).
  • Verify the tag matches SHORT_BUILD_VERSION in Marlin/Version.h (fail if mismatch).
  • Configurations: if the same tag exists, checkout that tag.
  • If Configurations lacks that tag, fallback to a matching release/bugfix branch and print a warning.
./rebase_and_reapply.sh

Normal mode applies customizations directly after source alignment (no automatic pre-dry-run step).

To only preview the re-apply step after source alignment:

./rebase_and_reapply.sh --dry-run

By default, --repo-root points to ../Marlin relative to this script.

By default the script is verbose. Use quiet mode when scripting:

python3 apply_config_customizations.py --dry-run --quiet

Strict mode (exit non-zero on warnings):

python3 apply_config_customizations.py --dry-run --strict

Colored output

The script emits colored output when run in a TTY terminal. Set NO_COLOR=1 to disable colors.

Use JSON instead of YAML if preferred:

python3 apply_config_customizations.py \
  --map-file example.json --dry-run

The customizer prints a final build hint plus EEPROM/config reset reminders after it finishes.

YAML dependency

YAML parsing requires PyYAML:

pip install pyyaml

If you do not want dependencies, use a .json map file via --map-file.

Safety notes

  • Always run --dry-run first on a new Marlin release.
  • Treat warnings as required manual review.
  • Do not assume all edits apply cleanly across major version jumps.