Configuration

Comodoro takes its TOML configuration from one of those paths:

  • $XDG_CONFIG_HOME/comodoro/config.toml
  • $HOME/.config/comodoro/config.toml
  • $HOME/.comodororc

The file should contain presets. A preset is a set of configuration gathered under a unique name, in a TOML table. Each set of configuration can be splitted into 3 categories:

[presets.a]
# config A here

[presets.b]
# config B here

# …

Example

Here a complete and documented config.sample.toml that you can actually test yourself with the following commands:

# start the server using TCP
$ comodoro server start example tcp

# in an other prompt, start the timer
$ comodoro timer start example tcp
# A preset is a set of configuration identified by a name.
[presets.example]

# TCP configuration, used by server binders and by clients.
# Requires the cargo feature "tcp".
tcp.host = "localhost"
tcp.port = 1234

# A cycle is a step in the timer lifetime, represented by a name and a
# duration. You can either define custom cycles:
cycles = [
  { name = "Work", duration = 5 },
  { name = "Rest", duration = 3 },
]

# Predefined cycles can also be used:
# preset = "pomodoro" | "52/17"

# Force the timer to stop after the given amount of loops:
# cycles-count = 5

# Customize the timer precision. Available options: second, minute, hour.
# timer-precision = "minute"

# A hook can be either a shell command or a system notification. Hook
# names follow the format "on-{name}-{event}", where "name" is the
# kebab-case version of the cycle name, and "event" the type of event:
# begin, running, set, pause, resume, end.
hooks.on-work-begin.notify.summary = "Comodoro"
hooks.on-work-begin.notify.body = "Work started!"
# hooks.on-work-begin.cmd = "notify-send Comodoro 'Work started!'"