Skip to content

Configuring Konfsave

selplacei edited this page Mar 10, 2021 · 3 revisions

konfsave.ini

Konfsave configuration is done using the konfsave.ini file, which is stored in $XDG_CONFIG_HOME/konfsave by default (usually, this is ~/.config/konfsave/konfsave.ini).

Just like in any configparser-format file, konfsave.ini is split into sections denoted by [square brackets]. All configuration that isn't related to path definitions is under the [Defaults] section; [Defaults] also contains the key "save-list", which specifies the default list of groups that Konfsave copies during saving or loading.

Lists in konfsave.ini are specified by comma-separated values. For example, if making a list that includes "kde" and "shells", the resulting value becomes "kde,shells". There should not be any whitespace before or after the comma.

After reading this page, see the default config file as an example of Konfsave configuration. That file should do the job for managing KDE configs.

Groups

A group is an identifier that stands for one or more sub-groups or individual paths. For example, whenever you write "kde-all", all config files that are related to KDE will be considered in that value. Thus, if you make "kde-all" the value of "save-list" (save-list=kde-all), Konfsave will try to save and load all files related to KDE (unless you specify something different with --include or --exclude).

Groups are defined in two sections: [XDG_CONFIG_HOME Path Definitions] and [Home Directory Path Definitions]. In both, the key is the path (relative to XDG_CONFIG_HOME or the home directory, respecitvely), and the value is a list of groups that this path should be included in. If, for example, you specify katerc=kde-apps,my-group under [XDG_CONFIG_HOME Path Definitions] and then save-list=my-group under [Defaults], the file ~/.config/katerc will be included even though the group kde-apps isn't in your save list.

Group names can contain anything except an equals sign, a semicolon, or a comma, but the standard is to use lower-skewer-case with no digits or special characters. Note that konfsave.ini never prepends the colon (:) to group names, but whenever groups are specified as command line options, they're prefixed with a colon; this helps tell them apart from file paths. For example, you would konfsave save --include :gtk rather than konfsave save --include gtk.

Metagroups

A metagroup is a special group that represents a wider and more intuitive list of configuration files; for example, appearance is a metagroup consisting of global-theme,plasma-style,application-style and others. Most metagroups only consist of other groups, but you can also promote ("redefine") a normal group to a metagroup so that it is included in konfsave groups -a - perhaps because it can't be broken down into sub-groups, but is still an important and separate part of your configuration.

Metagroups are defined under the [Metagroup Definitions] section. Every key represents a metagroup. If there is no value for a key, then that key should correspond to an existing group defined in the Path Definitions sections. Otherwise, the value should be a list of sub-groups (which may include other metagroups). Individual paths cannot be specified here. If another group with the same already exists, then it will be overwritten (not combined).

Exceptions

The sections [XDG_CONFIG_HOME Exceptions] and [Home Directory Exceptions] specify paths that will never be copied unless --included in the command line. Typically, this is used when a directory is added to a group, but certain files (such as sensitive info) should be excluded from that directory.

The keys specify paths relative to the section's respective directory, and should not contain any values.

Listing available groups

The action konfsave groups is designed to tell you which paths can be saved, without you having to read through the config. The save-list is listed by default. Run konfsave groups --help to see how to get a list of all available groups or metagroups and which actual files they contain.

Clone this wiki locally