Skip to content

Commit 4b0820e

Browse files
committed
feat: update documentation and provide examples and more information in the manifest chapter
1 parent 13cd5f1 commit 4b0820e

File tree

1 file changed

+85
-40
lines changed

1 file changed

+85
-40
lines changed

src/2_manifest.md

Lines changed: 85 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,131 @@
11
## Manifest
22

3-
Your plugin should contain a `manifest.json` file that supplies key information about your plugin to the OpenAction server. It should be present in the root of your plugin directory.
3+
Your plugin needs to contain a `manifest.json` file that supplies key information about your plugin to the OpenAction server. It should be present in the root of your plugin directory. The file is the primary description of your plugin and contains information like the path to your plugin's entrypoint and the actions it provides.
4+
5+
The equivalent Stream Deck SDK documentation on the plugin manifest can be found [here](https://docs.elgato.com/streamdeck/sdk/references/manifest), but it should be noted that the OpenAction API supports multiple extensions to the format documented there that Elgato Stream Deck does not.
6+
7+
#### Icon path format
8+
9+
Multiple properties within a plugin manifest are intended to be references to image files supplied in your plugin. These values should be forward-slash delimited path strings that point to image files, relative to your plugin directory.
10+
11+
However, these paths should be supplied without the file type extension. The OpenAction server will resolve the path by attempting to locate `.svg`, `@2x.png`, and `.png` versions of your image.
12+
13+
For example, if you set an icon property to `"icon"` in your plugin manifest, the OpenAction server will look for `icon.svg`, `[email protected]`, and `icon.png` files in the root of your plugin directory.
14+
15+
#### Example plugin manifest files
16+
17+
- <https://github.com/OpenActionPlugins/counter/blob/main/assets/manifest.json>
18+
- <https://github.com/OpenActionPlugins/system/blob/main/assets/manifest.json>
19+
20+
### Plugin manifest format
21+
22+
`*` is used to denote a required field.
423

524
```ts
625
{
7-
// The human-readable name of your plugin. Required
26+
// * The user-facing name of your plugin
827
Name: string,
9-
// The user-facing author string (e.g. "ninjadev64"). Required
28+
// * The user-facing author string (e.g. "nekename")
1029
Author: string,
11-
// The version of your plugin found in this directory. Required
30+
// * The version of your plugin present (e.g. "2.7.2"),
31+
// as a Semantic Versioning (https://semver.org) compliant version string
1232
Version: string,
13-
// An icon to represent your plugin, relative to your plugin root. Required
14-
// This icon should be provided in PNG format, without the ".png" suffix. You may also provide @2x versions of this image.
33+
// * An icon to represent your plugin, in the icon path format described above
1534
Icon: string,
16-
// The category for your plugin's actions to appear under.
35+
// The category your plugin's actions should appear under
1736
Category: string = "Custom",
18-
// The default path to your actions' property inspector.
37+
// An icon to represent the category your plugin's actions appear under,
38+
// which defaults to your plugin's icon if not specified
39+
CategoryIcon: string | null,
40+
// The relative path to the property inspector to be displayed for actions that don't specify their own
1941
PropertyInspectorPath: string | null,
20-
// The actions provided by your plugin. Required
42+
// Whether the plugin has its own GUI that the user can request to be shown through the OpenAction server
43+
// (not supported by Elgato Stream Deck)
44+
HasSettingsInterface: boolean = false,
45+
// A list of applications which, when launched or terminated, the OpenAction server should notify your plugin
46+
// (on macOS, set to the application's bundle ID, and on other platforms, set to the executable's name)
47+
ApplicationsToMonitor: {
48+
mac: string[],
49+
windows: string[],
50+
linux: string[]
51+
} = {},
52+
// * The actions provided by your plugin
2153
Actions: [
2254
{
23-
// The name of this action. Required
55+
// * The user-facing name of this action
2456
Name: string,
25-
// A unique identifier for this action. Required
57+
// * A unique identifier for this action, in reverse-DNS format,
58+
// that must start with your plugin's own UUID
2659
UUID: string,
27-
// A tooltip that sums up the purpose of this action.
60+
// A tooltip that describes the utility of this action
2861
Tooltip: string = "",
29-
// An icon to represent this action, relative to your plugin root. Required if visible in action list
30-
// This icon should be provided in PNG format, without the ".png" suffix. You may also provide @2x versions of this image.
62+
// * An icon to represent this action, in the icon path format described above
3163
Icon: string,
32-
// Whether or not to automatically toggle the state of this action on key up. Only applies to actions with two states.
64+
// Whether to automatically toggle the state of this action on key up
65+
// (only applies to actions with two states)
3366
DisableAutomaticStates: boolean = false,
34-
// Whether or not this action should be visible in the action list.
67+
// Whether this action should be visible in the action list
3568
VisibleInActionsList: boolean = true,
36-
// Whether or not this action should be supported in Multi Actions.
69+
// Whether this action should be supported in Multi Actions
3770
SupportedInMultiActions: boolean = true,
38-
// The path to this action's property inspector, if different to your plugin's default.
39-
PropertyInspectorPath: string = "<plugin default>",
40-
// The controllers this action should be supported on. Supported controllers are "Keypad" and "Encoder" (dials/sliders).
41-
Controllers: string[] = [ "Keypad" ],
42-
// The states that are part of this action. Required
71+
// The relative path to this action's property inspector, if it differs from your plugin's default
72+
PropertyInspectorPath: string | null,
73+
// The types of hardware this action should be supported on,
74+
// such as "Keypad" (buttons) or "Encoder" (dials, sliders or screens)
75+
Controllers: string[] = ["Keypad"],
76+
// * The different states this action can be displayed in
4377
States: [
4478
{
45-
// The image of this state relative to your plugin root or "actionDefaultImage".
79+
// The image of this state in the icon path format described above
80+
// or set to "actionDefaultImage" to use the action's icon
4681
Image: string = "actionDefaultImage",
47-
// The name of this state.
82+
// The name of this state
4883
Name: string = "",
49-
// The text to display on this state over the image.
84+
// The text to display over the image when in this state
5085
Title: string = "",
51-
// Whether or not to display the title over the image.
86+
// Whether to display the title over the image
5287
ShowTitle: boolean = true,
53-
// The colour of the state title.
54-
TitleColor: string = "<server dependent>",
55-
// The vertical alignment of the state title, either "top", "middle", or "bottom".
88+
// The colour of the state title
89+
TitleColor: string = "#FFFFFF",
90+
// The vertical alignment of the state title, set to "top", "middle", or "bottom"
5691
TitleAlignment: string = "middle",
57-
// The font style of the title, either "Regular", "Bold", "Italic", or "Bold Italic".
92+
// The font style of the title, set to "Regular", "Bold", "Italic", or "Bold Italic"
5893
FontStyle: string = "Regular",
59-
// The font size of the state title in pixels as rendered on a 72x72px state image.
94+
// The font size of the state title in pixels, as rendered on a 72x72px state image
6095
FontSize: string = "16",
61-
// Whether or not to underline the state title.
96+
// Whether to underline the state title or not
6297
FontUnderline: boolean = false
6398
}
6499
]
65100
}
66101
],
67-
// The operating systems your plugin is supported on. Required
102+
// * The operating systems your plugin is supported on
68103
OS: [
69104
{
70-
// The platform in question. Can be "windows", "mac", or "linux". Note that "linux" is not supported by Stream Deck. Required
105+
// * The platform in question, set to "windows", "mac", or "linux"
71106
Platform: string,
72-
// The minimum supported version of the platform in question.
107+
// The minimum supported version of the platform in question
73108
Version: string | null
74109
}
75110
],
76-
// The default path to your plugin executable file, relative to your plugin root.
77-
// HTML5 is supported if this value ends with the ".html" suffix, and Node.js if this value ends with any of ".js", ".cjs" and ".mjs".
111+
// The relative path to your plugin executable, to be used if no other code path is specified
112+
// (HTML5 and Node.js plugins should specify values ending in ".html" or ".js", ".cjs" or ".mjs", respectively)
78113
CodePath: string | null,
79-
// An override for CodePath on Windows.
114+
// Overrides for CodePath by platform, specified using the platform's target triple (https://doc.rust-lang.org/beta/rustc/platform-support.html)
115+
// (introduced over the CodePathWin, CodePathMac and CodePathLin properties in order to support multiple CPU architectures,
116+
// but not supported by Elgato Stream Deck or older versions of OpenDeck; therefore, the other properties below should also be specified)
117+
CodePaths: {
118+
"x86_64-pc-windows-msvc": string | null,
119+
"x86_64-apple-darwin": string | null,
120+
"aarch64-apple-darwin": string | null,
121+
"x86_64-unknown-linux-gnu": string | null,
122+
"aarch64-unknown-linux-gnu": string | null
123+
},
124+
// An override for CodePath to be used on Windows when not overridden in CodePaths
80125
CodePathWin: string | null,
81-
// An override for CodePath on macOS.
126+
// An override for CodePath to be used on macOS when not overridden in CodePaths
82127
CodePathMac: string | null,
83-
// An override for CodePath on Linux.
128+
// An override for CodePath to be used on Linux when not overridden in CodePaths
84129
CodePathLin: string | null
85130
}
86131
```

0 commit comments

Comments
 (0)