Skip to content

Configuration

Jakub Šatoplet edited this page May 4, 2022 · 3 revisions

General

Zigtoucher provides very fine configurability. Every setting is optional since we provide sensible defaults. These defaults can be seen in the default configuration file. One has three options to specify configuration values, configuration file, command line options and runtime parameters.

Types

Settings in our configuration use these data types and is self explanatory which settings are which type.

Name Python Definition
KEY str 128-bit hexstring with optional 0x prefix
IEEE str 64-bit hexstring with : as byte separator or <random>
INT[min,max] str,int Integer with optional lowest and highest value
FLOAT[min,max] str,float Float with optional lowest and highest value
PATH str Path to some file or <random>
SWITCH[v1,v2,...] str One of the provided values
LIST[type] str,list List of the given type, as string use , as separator
BOOL str,bool One of True, False, Yes, No, On, Off, Y, N

Configuration file

One has three options to provide a configuration file. Using the -c/--config switch, user configuration file with location based on XDG Base Directory Specification or global configuration file at /usr/local/etc/zigtoucher/zigtoucher.yml. Only one of these is used with precedence from highest as they were mentioned. But it is possible to not have a configuration file.

We use YAML as our format.

Configuration file has lowest priority of all ways to specify settings.

Command line options

Every value from configuration file can be specified as a long switch where the nesting is mapped using - as separator, for example --modes-timeout for the example bellow:

modes:
  timeout: 30

Interactive mode parameters

Modes in interactive mode can use parameters valid only for that one run, specified as key=value pairs and autocomplete will help with them. But if we look at the previous example, we throw away the nesting and specify only timeout=30. These parameters have highest priority and the unspecified ones will use values specified in config file or command line options.

We can now continue to usage.

Clone this wiki locally