World Conquest Chronicles

World Conquest Chronicles

Motivator, v1.2.0

The utility for repeatedly displaying notifications in the standard OS way.

Support for several different tasks for displaying notifications; support for displaying an icon for each notification; support for variable substitution in notifications.

Change Log

  • support for several different tasks for displaying notifications:
    • for each task:
      • support for displaying a task name:
        • automatic generation of a task name, if it was not specified;
        • add a sequential number to duplicated task names;
      • support for displaying an icon for each notification:
        • an icon can be specified for:
          • a notification;
          • a task;
          • the entire config;
        • for each notification, the first specified icon is selected in the order above;
  • support for variable substitution in notifications:
    • use the format of the os.Expand() function;
    • use one common list of variables to substitute in all notifications of all tasks;
  • select the app icon ().

Features

  • support for several different tasks for displaying notifications:
    • for each task:
      • support for displaying a task name:
        • automatic generation of a task name, if it was not specified;
        • add a sequential number to duplicated task names;
      • support for displaying an icon for each notification:
        • an icon can be specified for:
          • a notification;
          • a task;
          • the entire config;
        • for each notification, the first specified icon is selected in the order above;
      • use the cron specification for displaying notifications on a schedule:
        • support for seconds in the cron specification;
      • random selection of a notification for displaying;
      • support for the Spintax format in notifications;
  • support for variable substitution in notifications:
    • use the format of the os.Expand() function;
    • use one common list of variables to substitute in all notifications of all tasks;
  • built-in support for running in the background:
    • the console command for starting and restarting;
    • the console command for stopping;
    • the console command for checking of the current running status.

Config

Format of the config in the JSON Schema format:

{
  "type": "object",
  "required": ["tasks"],
  "properties": {
    "icon": {
      "type": "string",
      "description": "the path to the icon file"
    },
    "tasks": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": ["cron", "phrases"],
        "properties": {
          "name": {
            "type": "string"
          },
          "icon": {
            "type": "string",
            "description": "the path to the icon file"
          },
          "cron": {
            "type": "string",
            "description": "in the format of the `cron` specification"
          },
          "phrases": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": ["text"],
              "properties": {
                "icon": {
                  "type": "string",
                  "description": "the path to the icon file"
                },
                "text": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "variables": {
      "type": "object",
      "patternProperties": {
        "[A-Za-z0-9_]": {
          "type": "string"
        }
      }
    }
  }
}

Example of the config:

{
  "icon": "assets/power_fist.png",
  "tasks": [
    {
      "name": "Greetings",
      "icon": "assets/tube_only_please.png",
      "cron": "*/5 * * * * *",
      "phrases": [
        {
          "icon": "assets/no_transistor.png",
          "text": "$GREETING $SUBJECT, {hope {you're|you are} {okay|good}|have a nice day}"
        },
        {
          "text": "$GREETING{ $SUBJECT|}, how are you today?"
        }
      ]
    },
    {
      "name": "Pangrams",
      "cron": "*/10 * * * * *",
      "phrases": [
        {
          "text": "The {slow|quick} {fox|deer} {gracefully |}jumps over the {sleeping|lazy} dog"
        }
      ]
    }
  ],
  "variables": {
    "GREETING": "{Hello|Hey}",
    "SUBJECT": "world"
  }
}

Repository

Link: https://github.com/thewizardplusplus/motivator/tree/v1.2.0.

Content: code.

License: MIT.

Copyrights