Skip to content

Commit 0f60cd9

Browse files
committed
📝 Add version property to reference
1 parent 1ac06a8 commit 0f60cd9

File tree

1 file changed

+50
-19
lines changed

1 file changed

+50
-19
lines changed

src/content/docs/config-files.mdx

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Below are the default values of the configuration file.
7373

7474
```json5 title="config.json"
7575
{
76+
"version": "2.1.0",
7677
"locale": "auto",
7778
"showIntroductionDialog": true,
7879
"menuTheme": "default",
@@ -115,6 +116,13 @@ Below are the default values of the configuration file.
115116
}
116117
```
117118

119+
#### version <Badge text="soon!" variant="tip" />
120+
<small>Default value: `"version": "2.0.0"`</small>
121+
122+
This is the last Kando version which was used to write this configuration file.
123+
Kando will use this to determine whether the configuration file is up-to-date or needs a migration.
124+
Also, whenever Kando is started, it will create a backup of the configuration file if the version is not the same as the current version.
125+
118126
#### locale
119127
<small>Default value: `"locale": "auto"` </small>
120128

@@ -339,11 +347,12 @@ Can be one of `'top-left'`, `'top-right'`, `'bottom-left'`, or `'bottom-right'`.
339347
## Menu Configuration: `menus.json`
340348

341349
This file contains the configuration of the individual menus.
342-
There are two top-level JSON objects: `menus` contains a list of _Menu Descriptions_ and `collections` contains a list of _Menu Collection_.
350+
Besides the `version` property, there are two top-level JSON objects: `menus` contains a list of _Menu Descriptions_ and `collections` contains a list of _Menu Collection_.
343351
The latter is used in the settings dialog to group menus together.
344352

345353
```json5 title=menus.json
346354
{
355+
"version": "2.1.0",
347356
"menus": [
348357
{
349358
// First Menu Description.
@@ -365,15 +374,24 @@ The latter is used in the settings dialog to group menus together.
365374
}
366375
```
367376

368-
### Menu Descriptions
377+
#### version <Badge text="soon!" variant="tip" />
378+
<small>Default value: `"version": "2.0.0"`</small>
369379

370-
The items in the `menus` list are called menu descriptions.
371-
They are JSON objects with the following properties:
380+
This is the last Kando version which was used to write this configuration file.
381+
Kando will use this to determine whether the configuration file is up-to-date or needs a migration.
382+
Also, whenever Kando is started, it will create a backup of the configuration file if the version is not the same as the current version.
383+
384+
#### menus
385+
<small>Default value: `"menus": []`</small>
386+
387+
If the `menus` property is not present or empty at startup, Kando will create an example menu for you.
372388

373389
<Aside type="note">
374390
You can have a look at a the example menu configurations [here](https://github.com/kando-menu/kando/tree/main/src/main/example-menus)!
375391
</Aside>
376392

393+
The items in the `menus` list are called menu descriptions.
394+
They are JSON objects with the following properties:
377395

378396
<div style="width:150px">Property</div> | Description
379397
-------- | -----------
@@ -386,7 +404,7 @@ You can have a look at a the example menu configurations [here](https://github.c
386404
`conditions: {}` | A dictionary of conditions which must be met for the menu to be shown. [See below for details](#menu-conditions).
387405
`tags: []` | A list of tags which can be used to filter the menu in the settings dialog. If a menu has no tags, it will only be shown in the all-menus list or if a collection has no tags at all.
388406

389-
### Menu Conditions
407+
##### Menu Conditions
390408

391409
The `conditions` property of a menu description can contain a dictionary of conditions.
392410
Only if all conditions are met, the menu will be shown.
@@ -397,7 +415,7 @@ Only if all conditions are met, the menu will be shown.
397415
`windowName: ""` | The name of the window which must be focused for the menu to be shown. It is interpreted in the same way as `appName`.
398416
`screenArea: {}` | A dictionary with the optional properties `xMin`, `xMax`, `yMin`, and `yMax`. The menu will only be shown if the mouse cursor is within the given screen area. The values are given in pixels and are relative to the top-left corner of the screen. If a value is not given, the area is unbounded in this direction.
399417

400-
### Menu Item Descriptions
418+
##### Menu Item Descriptions
401419

402420
The layout of the menu is described by a tree of menu items.
403421
Each menu item is a JSON object with the following properties:
@@ -412,19 +430,7 @@ Each menu item is a JSON object with the following properties:
412430
`data: {}` | Depending on the type of the item, this can or must contain additional data. [See below for details](#menu-item-types).
413431
`children: []` | If the menu item is a submenu, this contains a list of child items. Each object in this list is a menu item description as well.
414432

415-
### Menu Collections
416-
417-
The `collections` property of the `menus.json` file contains a list of menu collections.
418-
A menu collection is a JSON object with the following properties:
419-
420-
<div style="width:150px">Property</div> | Description
421-
-------- | -----------
422-
`name: "undefined"` | The name of the menu collection. This is shown in the settings dialog if the collection is selected.
423-
`icon: ""` | The name of the icon from the given icon theme. The icon is shown in the left sidebar of the settings dialog. The behavior is the same as for the `icon` property of a menu item description.
424-
`iconTheme: ""` | The icon theme to use for the icon. The behavior is the same as for the `iconTheme` property of a menu item description.
425-
`tags: []` | A list of strings which determine which menus belong to this collection. The tags are used to filter the menus in the settings dialog. If a menu has all tags of a collection, it will be shown in the collection. If a menu has no tags, it will only be shown in the all-menus list or if a collection has no tags at all.
426-
427-
### Menu Item Types
433+
##### Menu Item Types
428434

429435
For now, the `type` property of a menu item can be one of the following values:
430436
* [`"command"`](/item-run-command)
@@ -438,3 +444,28 @@ For now, the `type` property of a menu item can be one of the following values:
438444
* [`"uri"`](/item-open-uri)
439445

440446
Click on these links to learn more about the individual item types and which `data` properties they require.
447+
448+
#### collections
449+
<small>Default value:</small>
450+
```json
451+
"collections": [{
452+
"name": "Favorites",
453+
"icon": "favorite",
454+
"iconTheme": "material-symbols-rounded",
455+
"tags": [
456+
"favs"
457+
]
458+
}]
459+
```
460+
461+
The `collections` property of the `menus.json` file contains a list of menu collections.
462+
A menu collection is a JSON object with the following properties:
463+
464+
<div style="width:150px">Property</div> | Description
465+
-------- | -----------
466+
`name: "undefined"` | The name of the menu collection. This is shown in the settings dialog if the collection is selected.
467+
`icon: ""` | The name of the icon from the given icon theme. The icon is shown in the left sidebar of the settings dialog. The behavior is the same as for the `icon` property of a menu item description.
468+
`iconTheme: ""` | The icon theme to use for the icon. The behavior is the same as for the `iconTheme` property of a menu item description.
469+
`tags: []` | A list of strings which determine which menus belong to this collection. The tags are used to filter the menus in the settings dialog. If a menu has all tags of a collection, it will be shown in the collection. If a menu has no tags, it will only be shown in the all-menus list or if a collection has no tags at all.
470+
471+

0 commit comments

Comments
 (0)