Configuration file formats

Updated 4 November 2026

A format is what the utilities "know" about the syntax of a particular kind of configuration file. You set it in the template header with the format= parameter, and it defines how the template body will be merged with the file that already exists: what counts as a record, what separates a name from its value, what comments look like and how to delete a parameter.

There is a single rule for choosing: the format is taken from the syntax of the targeted file, not from what is easier to write. The template body must look like a piece of a real config file - then the line order, the quotes and the comments of the original file are preserved.

If format= is not specified, the file counts as "raw" (raw) and no merge is performed: the target is rewritten entirely. For a deliberate full rewrite this is fine, but you must add comment= with the comment character that the targeted program understands; otherwise the control record "Modified Calculate Utilities" will make the file unreadable to it.

Three families

Directive files

Parsed with regular expressions, the objShare class: bind, apache, postfix, dovecot, dhcp, procmail, squid, openrc. Here three format regular expressions set the syntax: where a comment starts, what cuts the line and which separator is inserted back.

Ini files with sections

The samba class and its descendants: samba, kde, ldap, compiz, plasma. Groups in square brackets and name/value pairs; removal is !ключ=.

Structural formats

Parsed as an object, not line by line: xml_xfce, xml_xfcepanel, xml_gconf, xml_gconf_tree are XML; json is JSON; world is a list of atoms; kernel is the kernel's .config; plus formats that do not describe the file text at all: patch, diff, contents, sqlite, dconf, backgrounds.

The full list with details is in the formats reference.

Choosing: short answers

  • KDE/GNOME configs, *.desktop, *.src, ini files with nested [A][B] groups → kde.
  • smb.conf, Calculate *.env files, classic ini → samba.
  • /etc/conf.d/* (openrc scripts) → openrc.
  • Other files with key = value pairs and no sections → procmail.
  • A file of an unknown format where you need to change two lines → patch: it works with regular expressions and requires no syntax parsing.
  • You need to apply a patch to package sources → diff.
  • An Xfce/gconf config → xml_xfce / xml_gconf.

kde versus samba: the real difference

Formally, kde is an extension of samba and the model is shared: groups in brackets, key = value, comments kept in place. There are three differences, and all of them show in the result.

Nested groups

Only kde understands nested groups. A file like

[AC][DPMSControl]
idleTime=900

in kde is kept as is, while in samba the nested part of the header is lost - what remains is [AC]. That is also where format=plasma for KDE settings with multi-level groups comes from.

The + and - prefixes

The + and - prefixes work only in samba. In samba, the record +browse list = no updates the real key browse list; in kde the sign stays inside the name, and a parameter with the literal name +browse list is created, which will never match an existing one. The same goes for -. So in kde you need to write the ordinary key = value form for setting and !ключ= для удаления — последнее работает в обоих форматах одинаково.

Comments

In samba, a line counts as a comment whether it starts with # or ;; in kde, only #. That does not change how the result looks, but a ; line in a kde template stops being a comment.

What stays the same: spaces around =, an inline # inside a value, an empty template body, and the preserved order and quotes. So for a simple ini without nested groups and without +/- the result will be the same - go by whichever format the system already uses for this file: a match rules out situations where two templates treat one file differently.

Checking the behavior of your own format

To quickly see what will come out without touching the system, use an offline merge - see the diagnostics checklist. For real examples, it is worth checking against the calculate tree: for almost any kind of config file there is already a sample template there.

See also