Added json schema (#65)

This commit is contained in:
Erik Reider 2022-01-26 18:41:15 +01:00 committed by GitHub
parent a91b440fd4
commit 5b505ca09b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 108 additions and 2 deletions

View File

@ -1,4 +1,5 @@
{
"$schema": @JSONPATH@,
"positionX": "right",
"positionY": "top",
"control-center-margin-top": 0,

94
src/configSchema.json Normal file
View File

@ -0,0 +1,94 @@
{
"title": "SwayNotificationCenter JSON schema",
"type": "object",
"properties": {
"positionX": {
"type": "string",
"description": "Horizontal position of control center and notification window",
"default": "right",
"enum": [
"right",
"left"
]
},
"positionY": {
"type": "string",
"description": "Vertical position of control center and notification window",
"default": "top",
"enum": [
"top",
"bottom"
]
},
"control-center-margin-top": {
"type": "integer",
"description": "The margin (in pixels) at the top of the notification center. 0 to disable",
"default": 0
},
"control-center-margin-bottom": {
"type": "integer",
"description": "The margin (in pixels) at the bottom of the notification center. 0 to disable",
"default": 0
},
"control-center-margin-right": {
"type": "integer",
"description": "The margin (in pixels) at the right of the notification center. 0 to disable",
"default": 0
},
"control-center-margin-left": {
"type": "integer",
"description": "The margin (in pixels) at the left of the notification center. 0 to disable",
"default": 0
},
"timeout": {
"type": "integer",
"description": "The notification timeout for notifications with normal priority",
"default": 10
},
"timeout-low": {
"type": "integer",
"description": "The notification timeout for notifications with low priority",
"default": 5
},
"timeout-critical": {
"type": "integer",
"description": "The notification timeout for notifications with critical priority. 0 to disable",
"default": 0
},
"notification-window-width": {
"type": "integer",
"description": "Width of the notification in pixels",
"default": 500
},
"keyboard-shortcuts": {
"type": "boolean",
"description": "If control center should use keyboard shortcuts",
"default": true
},
"image-visibility": {
"type": "string",
"description": "An explanation about the purpose of this instance.",
"default": "always",
"enum": [
"always",
"when-available",
"never"
]
},
"transition-time": {
"type": "integer",
"description": "The notification animation duration. 0 to disable",
"default": 200
},
"hide-on-clear": {
"type": "boolean",
"description": "Hides the control center after pressing \"Clear All\"",
"default": false
},
"hide-on-action": {
"type": "boolean",
"description": "Hides the control center when clicking on notification action",
"default": true
}
}
}

View File

@ -57,5 +57,16 @@ executable('swaync-client',
install: true,
)
install_data('style.css', install_dir : join_paths(sysconfdir, 'xdg/swaync'))
install_data('config.json', install_dir : join_paths(sysconfdir, 'xdg/swaync'))
config_path = join_paths(sysconfdir, 'xdg/swaync')
config_data = configuration_data()
config_data.set_quoted('JSONPATH', join_paths('/', config_path, 'configSchema.json'))
config_json = configure_file(
input : 'config.json.in',
output : 'config.json',
configuration : config_data
)
install_data('style.css', install_dir : config_path)
install_data(config_json, install_dir : config_path)
install_data('configSchema.json', install_dir : config_path)