{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "description": "Pointer to the schema against which this document should be validated.",
      "type": "string"
    },
    "control-center-height": {
      "default": 600,
      "description": "Height of the control center in pixels. Ignored when 'fit-to-screen' is set to 'true'",
      "minimum": 300,
      "type": "integer"
    },
    "control-center-margin-bottom": {
      "default": 0,
      "description": "The margin (in pixels) at the bottom of the notification center. 0 to disable",
      "type": "integer"
    },
    "control-center-margin-left": {
      "default": 0,
      "description": "The margin (in pixels) at the left of the notification center. 0 to disable",
      "type": "integer"
    },
    "control-center-margin-right": {
      "default": 0,
      "description": "The margin (in pixels) at the right of the notification center. 0 to disable",
      "type": "integer"
    },
    "control-center-margin-top": {
      "default": 0,
      "description": "The margin (in pixels) at the top of the notification center. 0 to disable",
      "type": "integer"
    },
    "control-center-positionX": {
      "default": "none",
      "description": "Optional: Horizontal position of the control center. Supersedes positionX if not set to `none`",
      "enum": [
        "right",
        "left",
        "center",
        "none"
      ],
      "type": "string"
    },
    "control-center-positionY": {
      "default": "none",
      "description": "Optional: Vertical position of the control center. Supersedes positionY if not set to `none`",
      "enum": [
        "top",
        "bottom",
        "none"
      ],
      "type": "string"
    },
    "control-center-width": {
      "default": 500,
      "description": "Width of the control center in pixels",
      "minimum": 300,
      "type": "integer"
    },
    "cssPriority": {
      "default": "application",
      "description": "Which GTK priority to use when loading the default and user CSS files. Pick \"user\" to override XDG_CONFIG_HOME/gtk-3.0/gtk.css",
      "enum": [
        "application",
        "user"
      ],
      "type": "string"
    },
    "fit-to-screen": {
      "default": true,
      "description": "If the control center should expand to both edges of the screen",
      "type": "boolean"
    },
    "hide-on-action": {
      "default": true,
      "description": "Hides the control center when clicking on notification action",
      "type": "boolean"
    },
    "hide-on-clear": {
      "default": false,
      "description": "Hides the control center after pressing \"Clear All\"",
      "type": "boolean"
    },
    "image-visibility": {
      "default": "when-available",
      "description": "An explanation about the purpose of this instance.",
      "enum": [
        "always",
        "when-available",
        "never"
      ],
      "type": "string"
    },
    "keyboard-shortcuts": {
      "default": true,
      "description": "If control center should use keyboard shortcuts",
      "type": "boolean"
    },
    "layer": {
      "default": "top",
      "description": "Layer of control center window",
      "enum": [
        "background",
        "bottom",
        "top",
        "overlay"
      ],
      "type": "string"
    },
    "notification-body-image-height": {
      "default": 100,
      "description": "The notification body image height (in pixels)",
      "minimum": 100,
      "type": "integer"
    },
    "notification-body-image-width": {
      "default": 200,
      "description": "The notification body image width (in pixels)",
      "minimum": 200,
      "type": "integer"
    },
    "notification-icon-size": {
      "default": 64,
      "description": "The notification icon size (in pixels)",
      "minimum": 16,
      "type": "integer"
    },
    "notification-visibility": {
      "additionalProperties": false,
      "description": "Set the visibility of each incoming notification. If the notification doesn't include one of the properties, that property will be ignored. All properties (except for state) use regex. If all properties match the given notification, the notification will be follow the provided state. Only the first matching object will be used.",
      "minProperties": 1,
      "patternProperties": {
        "^.{1,}$": {
          "additionalProperties": false,
          "description": "Your script object.",
          "minProperties": 2,
          "properties": {
            "app-name": {
              "description": "The app-name. Uses Regex.",
              "type": "string"
            },
            "body": {
              "description": "The body of the notification. Uses Regex.",
              "type": "string"
            },
            "category": {
              "description": "Which category the notification belongs to. Uses Regex.",
              "type": "string"
            },
            "desktop-entry": {
              "description": "The desktop-entry. Uses Regex.",
              "type": "string"
            },
            "override-urgency": {
              "default": "unset",
              "description": "The new urgency of the notification (optional)",
              "enum": [
                "unset",
                "low",
                "normal",
                "critical"
              ],
              "type": "string"
            },
            "state": {
              "default": "enabled",
              "description": "The notification visibility state.",
              "enum": [
                "ignored",
                "muted",
                "enabled",
                "transient"
              ],
              "type": "string"
            },
            "summary": {
              "description": "The summary of the notification. Uses Regex.",
              "type": "string"
            },
            "urgency": {
              "default": "Normal",
              "description": "The urgency of the notification.",
              "enum": [
                "Low",
                "Normal",
                "Critical"
              ],
              "type": "string"
            }
          },
          "required": [
            "state"
          ],
          "type": "object"
        }
      },
      "type": "object"
    },
    "notification-window-width": {
      "default": 500,
      "description": "Width of the notification in pixels",
      "type": "integer"
    },
    "positionX": {
      "default": "right",
      "description": "Horizontal position of control center and notification window",
      "enum": [
        "right",
        "left",
        "center"
      ],
      "type": "string"
    },
    "positionY": {
      "default": "top",
      "description": "Vertical position of control center and notification window",
      "enum": [
        "top",
        "bottom"
      ],
      "type": "string"
    },
    "script-fail-notify": {
      "default": true,
      "description": "Sends a notification if a script fails to run",
      "type": "boolean"
    },
    "scripts": {
      "additionalProperties": false,
      "description": "Which scripts to check and potentially run for every notification. If the notification doesn't include one of the properties, that property will be ignored. All properties (except for exec) use regex. If all properties match the given notification, the script will be run. Only the first matching script will be run.",
      "minProperties": 1,
      "patternProperties": {
        "^.{1,}$": {
          "additionalProperties": false,
          "description": "Your script object.",
          "minProperties": 2,
          "properties": {
            "app-name": {
              "description": "The app-name. Uses Regex.",
              "type": "string"
            },
            "body": {
              "description": "The body of the notification. Uses Regex.",
              "type": "string"
            },
            "category": {
              "description": "Which category the notification belongs to. Uses Regex.",
              "type": "string"
            },
            "desktop-entry": {
              "description": "The desktop-entry. Uses Regex.",
              "type": "string"
            },
            "exec": {
              "description": "The script to run. Can also run regular shell commands.",
              "type": "string"
            },
            "run-on": {
              "default": "receive",
              "description": "Whether to run the script on an action being activated, or when the notification is received.",
              "enum": [
                "action",
                "receive"
              ],
              "type": "string"
            },
            "summary": {
              "description": "The summary of the notification. Uses Regex.",
              "type": "string"
            },
            "urgency": {
              "default": "Normal",
              "description": "The urgency of the notification.",
              "enum": [
                "Low",
                "Normal",
                "Critical"
              ],
              "type": "string"
            }
          },
          "required": [
            "exec"
          ],
          "type": "object"
        }
      },
      "type": "object"
    },
    "timeout": {
      "default": 10,
      "description": "The notification timeout for notifications with normal priority",
      "type": "integer"
    },
    "timeout-critical": {
      "default": 0,
      "description": "The notification timeout for notifications with critical priority. 0 to disable",
      "type": "integer"
    },
    "timeout-low": {
      "default": 5,
      "description": "The notification timeout for notifications with low priority",
      "type": "integer"
    },
    "transition-time": {
      "default": 200,
      "description": "The notification animation duration. 0 to disable",
      "type": "integer"
    },
    "widget-config": {
      "additionalProperties": false,
      "description": "Configure specific widget properties.",
      "patternProperties": {
        "^backlight(#[a-zA-Z0-9_-]{1,}){0,1}?$": {
          "$ref": "#/widgets/backlight"
        },
        "^buttons-grid(#[a-zA-Z0-9_-]{1,}){0,1}?$": {
          "$ref": "#/widgets/buttons-grid"
        },
        "^dnd(#[a-zA-Z0-9_-]{1,}){0,1}?$": {
          "$ref": "#/widgets/dnd"
        },
        "^inhibitors(#[a-zA-Z0-9_-]{1,}){0,1}?$": {
          "$ref": "#/widgets/inhibitors"
        },
        "^label(#[a-zA-Z0-9_-]{1,}){0,1}?$": {
          "$ref": "#/widgets/label"
        },
        "^menubar(#[a-zA-Z0-9_-]{1,}){0,1}?$": {
          "$ref": "#/widgets/menubar"
        },
        "^mpris(#[a-zA-Z0-9_-]{1,}){0,1}?$": {
          "$ref": "#/widgets/mpris"
        },
        "^title(#[a-zA-Z0-9_-]{1,}){0,1}?$": {
          "$ref": "#/widgets/title"
        },
        "^volume(#[a-zA-Z0-9_-]{1,}){0,1}?$": {
          "$ref": "#/widgets/volume"
        }
      },
      "type": "object"
    },
    "widgets": {
      "default": [
        "inhibitors",
        "title",
        "dnd",
        "notifications"
      ],
      "description": "Which order and which widgets to display. If the \"notifications\" widget isn't specified, it will be placed at the bottom.",
      "items": {
        "pattern": "^[a-zA-Z0-9_-]{1,}(#[a-zA-Z0-9_-]{1,}){0,1}?$",
        "type": "string"
      },
      "type": "array"
    }
  },
  "title": "SwayNotificationCenter JSON schema",
  "type": "object",
  "widgets": {
    "backlight": {
      "additionalProperties": false,
      "description": "Slider to control monitor brightness",
      "properties": {
        "device": {
          "default": "intel_backlight",
          "description": "Name of monitor (find possible devices using `ls /sys/class/backlight` or `ls /sys/class/leds`)",
          "type": "string"
        },
        "label": {
          "default": "Brightness",
          "description": "Text displayed in front of the backlight slider",
          "type": "string"
        },
        "min": {
          "default": 0,
          "description": "Lowest possible value for brightness",
          "type": "integer"
        },
        "subsystem": {
          "default": "backlight",
          "description": "Kernel subsystem for brightness control",
          "enum": [
            "backlight",
            "leds"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "buttons-grid": {
      "additionalProperties": false,
      "description": "A widget to add a grid of buttons that execute shell commands",
      "properties": {
        "actions": {
          "description": "A list of actions containing a label and a command",
          "items": {
            "properties": {
              "command": {
                "default": "",
                "description": "Command to be executed on click",
                "type": "string"
              },
              "label": {
                "default": "label",
                "description": "Text to be displayed in button",
                "type": "string"
              }
            },
            "type": "object"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "dnd": {
      "additionalProperties": false,
      "description": "Control Center Do Not Disturb Widget",
      "properties": {
        "text": {
          "default": "Do Not Disturb",
          "description": "The title of the widget",
          "type": "string"
        }
      },
      "type": "object"
    },
    "inhibitors": {
      "additionalProperties": false,
      "description": "Control Center Inhibitors Widget",
      "properties": {
        "button-text": {
          "default": "Clear All",
          "description": "\"Clear All\" button text",
          "type": "string"
        },
        "clear-all-button": {
          "default": true,
          "description": "Wether to display a \"Clear All\" button",
          "type": "boolean"
        },
        "text": {
          "default": "Inhibitors",
          "description": "The title of the widget",
          "type": "string"
        }
      },
      "type": "object"
    },
    "label": {
      "additionalProperties": false,
      "description": "A generic widget that allows the user to add custom text",
      "properties": {
        "max-lines": {
          "default": 5,
          "description": "The maximum lines",
          "type": "integer"
        },
        "text": {
          "default": "Label Text",
          "description": "The text content of the widget",
          "type": "string"
        }
      },
      "type": "object"
    },
    "menubar": {
      "additionalProperties": false,
      "description": "A bar that contains action-buttons and buttons to open a dropdown with action-buttons",
      "patternProperties": {
        "^buttons(#[a-zA-Z0-9_-]{1,}){0,1}?$": {
          "additionalProperties": false,
          "description": "A list of action-buttons to be displayed in the topbar",
          "properties": {
            "actions": {
              "$ref": "#/widgets/buttons-grid/properties/actions"
            },
            "position": {
              "default": "right",
              "description": "Horizontal position of the button in the bar",
              "enum": [
                "right",
                "left"
              ],
              "type": "string"
            }
          },
          "type": "object"
        },
        "^menu(#[a-zA-Z0-9_-]{1,}){0,1}?$": {
          "additionalProperties": false,
          "description": "A button that opens a dropdown with action-buttons",
          "properties": {
            "actions": {
              "$ref": "#/widgets/buttons-grid/properties/actions"
            },
            "label": {
              "default": "Menu",
              "description": "Text to be displayed in button",
              "type": "string"
            },
            "position": {
              "default": "right",
              "description": "Horizontal position of the button in the bar",
              "enum": [
                "right",
                "left"
              ],
              "type": "string"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    },
    "mpris": {
      "additionalProperties": false,
      "description": "A widget that displays multiple music players",
      "properties": {
        "image-radius": {
          "default": 12,
          "description": "The border radius of the album art",
          "type": "integer"
        },
        "image-size": {
          "default": 96,
          "description": "The size of the album art",
          "type": "integer"
        }
      },
      "type": "object"
    },
    "title": {
      "additionalProperties": false,
      "description": "Control Center Title Widget",
      "properties": {
        "button-text": {
          "default": "Clear All",
          "description": "\"Clear All\" button text",
          "type": "string"
        },
        "clear-all-button": {
          "default": true,
          "description": "Wether to display a \"Clear All\" button",
          "type": "boolean"
        },
        "text": {
          "default": "Notifications",
          "description": "The title of the widget",
          "type": "string"
        }
      },
      "type": "object"
    },
    "volume": {
      "additionalProperties": false,
      "description": "Slider to control pulse volume",
      "properties": {
        "label": {
          "default": "Volume",
          "description": "Text displayed in front of the volume slider",
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}