You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- run `sudo udevadm control --reload-rules` to reload the udev rules
15
-
16
-
Then xdotool will be required to simulate keypresses, to install this run:
17
-
18
-
#### Arch
19
-
20
-
`sudo pacman -S xdotool`
21
-
22
-
#### Debian based
23
-
24
-
`sudo apt install xdotool`
25
14
15
+
- run `sudo udevadm control --reload-rules` to reload the udev rules
16
+
17
+
Then xdotool will be required to simulate keypresses, to install this run:
18
+
19
+
#### Arch
20
+
21
+
`sudo pacman -S xdotool`
22
+
23
+
#### Debian based
24
+
25
+
`sudo apt install xdotool`
26
26
27
27
### Configuration
28
28
@@ -34,18 +34,30 @@ An example config would be something like:
34
34
35
35
```json
36
36
{
37
-
"pages": [
38
-
[
39
-
{
40
-
"switch_page": 1,
41
-
"icon": "~/icon.png"
42
-
}
43
-
]
37
+
"modules": [
38
+
"/home/user/module.so"
39
+
],
40
+
"decks": [
41
+
{
42
+
"serial": "AB12C3D45678",
43
+
"pages": [
44
+
[
45
+
{
46
+
"switch_page": 1,
47
+
"icon": "~/icon.png"
48
+
}
49
+
]
50
+
]
51
+
}
44
52
]
45
53
}
46
54
```
47
55
48
-
The outer array is the list of pages, the inner array is the list of button on that page, with the buttons going in a right to left order.
56
+
At the top is the list of custom modules, these are go plugins in the .so format, following that is the list of deck
57
+
objects, each represents a different streamdeck device, and contains its serial, and its list of pages
58
+
59
+
The outer array in a deck is the list of pages, the inner array is the list of button on that page, with the buttons
60
+
going in a right to left order.
49
61
50
62
The actions you can have on a button are:
51
63
@@ -55,28 +67,77 @@ The actions you can have on a button are:
55
67
-`brightness`: set the brightness of the streamdeck as a percentage
56
68
-`switch_page`: change the active page on the streamdeck
57
69
58
-
59
70
### D-Bus
60
71
61
-
There is a D-Bus interface built into the daemon, the service name and interface for D-Bus are `com.unixstreamdeck.streamdeckd` and `com/unixstreamdeck/streamdeckd` respectively, and is made up of the following methods/signals
72
+
There is a D-Bus interface built into the daemon, the service name and interface for D-Bus
73
+
are `com.unixstreamdeck.streamdeckd` and `com/unixstreamdeck/streamdeckd` respectively, and is made up of the following
74
+
methods/signals
62
75
63
76
#### Methods
64
77
65
-
- GetConfig - returns the current running config
66
-
- SetConfig - sets the config, without saving to disk, takes in Stringified json, returns an error if anything breaks
67
-
- ReloadConfig - reloads the config from disk
68
-
- GetDeckInfo - Returns information about the active streamdeck in the format of
78
+
- GetConfig - returns the current running config
79
+
- SetConfig - sets the config, without saving to disk, takes in Stringified json, returns an error if anything breaks
80
+
- ReloadConfig - reloads the config from disk
81
+
- GetDeckInfo - Returns information about all the active streamdecks in the format of
82
+
69
83
```json
70
-
{
71
-
"icon_size": 72,
72
-
"rows": 3,
73
-
"cols": 5,
74
-
"page": 0
75
-
}
84
+
[
85
+
{
86
+
"icon_size": 72,
87
+
"rows": 3,
88
+
"cols": 5,
89
+
"page": 0,
90
+
"serial": "AB12C3D45678"
91
+
}
92
+
]
76
93
```
94
+
77
95
- SetPage - Set the page on the streamdeck to the number passed to it, returns an error if anything breaks
78
-
- CommitConfig - Commits the currently active config to disk, returns an error if anything breaks
96
+
- CommitConfig - Commits the currently active config to disk, returns an error if anything breaks
97
+
- GetModules - Get the list of loaded modules, and the config fields those modules use
98
+
- PressButton - Simulates a button press on the streamdeck device, consumes a device serial, and a key index
99
+
79
100
80
101
#### Signals
81
102
82
103
- Page - sends the number of the page switched to on the StreamDeck
104
+
105
+
### Custom Modules
106
+
107
+
To create custom modules, I suggest looking at the gif, counter, and time modules in the example handlers package in streamdeckd, they should be in a file with the GetModule method as shown below
108
+
109
+
#### Loading Modules into streamdeckd
110
+
111
+
Modules require a method on them in the main package called "GetModule" that returns an instance of [handler.Module](https://github.com/unix-streamdeck/streamdeckd/blob/575e672c26f275d35a016be6406ceb8480ccfff5/handlers/handlers.go#L9) e.g
112
+
113
+
```go
114
+
package main
115
+
116
+
typeCustomIconHandlerstruct {
117
+
118
+
}
119
+
...
120
+
121
+
typeCustomKeyHandlerstruct {
122
+
123
+
}
124
+
...
125
+
126
+
funcGetModule() handlers.Module {
127
+
return handlers.Module{
128
+
Name: "CustomModule", // the name that will be used in the icon_handler/key_handler field in the config, and that will be shown in the handler dropdown in streamdeckui
129
+
NewIcon: func() api.IconHandler { return &CustomerIconHandler{}}, // Method to create a new instance of the Icon handler, if left empty, streamdeckui will not include it in the icon handler fields
130
+
NewKey: func() api.KeyHandler { return &CustomerKeyHandler{}}, // Method to create a new instance of the Key Handler, if left empty, streamdeckui will not include it in the key handler fields
131
+
IconFields: []api.Field{ // list of fields to be shown in streamdeckui when the icon handler is selected
132
+
{
133
+
Title: "Icon", // name of field to show in UI
134
+
Name: "icon", // name of field that will be included in the iconHandlerFields map
135
+
Type: "File"// type of input to show on streamdeckui, options are Text, File, TextAlignment, and Number
136
+
FileTypes: []string{".png", ".jpg"} // Allowed file types if a File input type is used
0 commit comments