[settings]
config_dir = "."
db_path = "towncrier.db"
log_level = "Information"

[[rule]]
id = "test"
enabled = true

  [[rule.trigger]]
  type = "timer"
  cron = "*/1 * * * *"

  [rule.condition]
  expression = 'true'

  [rule.toast]
  title = "Test notification"
  body = "This is a test notification every minute"

[[rule]]
id = "check-api-health"
enabled = true

  [[rule.trigger]]
  type = "timer"
  cron = "*/5 * * * *"

  [[rule.trigger]]
  type = "http"
  url = "https://api.example.com/health"
  method = "GET"

  [[rule.variable]]
  name = "status"
  from = "http.body"
  jsonpath = "$.status"

  [rule.condition]
  expression = '{{ status != "healthy" }}'

  [rule.toast]
  title = "API {{ status }}"
  body = "Status changed to {{ status }}"
  scenario = "reminder"

    [rule.toast.action]
    action = "open_url"
    url = "https://dashboard.example.com/{{ status }}"
    # Default is background activation; set foreground = true to bring the app forward.

    [[rule.toast.button]]
    label = "Snooze"
    action = "snooze"

    [[rule.toast.button]]
    label = "Open dashboard"
    action = "open_url"
    url = "https://dashboard.example.com"
    foreground = true

    [[rule.toast.button]]
    label = "Disable regel"
    action = "disable_rule"

[[rule]]
id = "disk-space"
enabled = true

  [[rule.trigger]]
  type = "process"
  command = "powershell"
  args = ["-Command", "Write-Output 'free=8'"]

  [[rule.variable]]
  name = "free_gb"
  from = "process.stdout"
  regex = 'free=(\d+)'

  [rule.condition]
  expression = '{{ free_gb == "8" }}'

  [rule.toast]
  title = "Low disk space"
  body = "Only {{ free_gb }} GB free"

[[rule]]
id = "file-watch"
enabled = true

  [[rule.trigger]]
  type = "file"
  path = "C:/temp/example.log"

  [[rule.variable]]
  name = "line"
  from = "file.text"
  regex = "ERROR: (.*)"
  default = "none"

  [rule.toast]
  title = "File content changed"
  body = "{{ line }}"
