Skip to content

Commit 0ae9f9a

Browse files
committed
Updated README
1 parent 48c41c1 commit 0ae9f9a

File tree

1 file changed

+81
-40
lines changed

1 file changed

+81
-40
lines changed

README.md

+81-40
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
# Streamdeckd
1+
# Streamdeckd
2+
3+
### Installation
4+
5+
- create the file `/etc/udev/rules.d/50-elgato.rules` with the following config
26

3-
### Installation
4-
5-
- create the file `/etc/udev/rules.d/50-elgato.rules` with the following config
67
```
78
SUBSYSTEM=="input", GROUP="input", MODE="0666"
89
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0060", MODE:="666", GROUP="plugdev"
910
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0063", MODE:="666", GROUP="plugdev"
1011
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006c", MODE:="666", GROUP="plugdev"
1112
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006d", MODE:="666", GROUP="plugdev"
1213
```
13-
14-
- 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`
2514

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`
2626

2727
### Configuration
2828

@@ -34,18 +34,30 @@ An example config would be something like:
3434

3535
```json
3636
{
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+
}
4452
]
4553
}
4654
```
4755

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.
4961

5062
The actions you can have on a button are:
5163

@@ -55,38 +67,67 @@ The actions you can have on a button are:
5567
- `brightness`: set the brightness of the streamdeck as a percentage
5668
- `switch_page`: change the active page on the streamdeck
5769

58-
5970
### D-Bus
6071

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
6275

6376
#### Methods
6477

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+
6983
```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+
]
7693
```
94+
7795
- 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+
79100

80101
#### Signals
81102

82103
- Page - sends the number of the page switched to on the StreamDeck
83104

105+
### Custom Modules
84106

85-
### Custom Handlers
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
86108

109+
#### Loading Modules into streamdeckd
87110

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
88112

89-
#### Button Press Handler
113+
```go
114+
package main
90115

116+
func GetModule() handlers.Module {
117+
return handlers.Module{
118+
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
119+
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
120+
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
121+
IconFields: []api.Field{ // list of fields to be shown in streamdeckui when the icon handler is selected
122+
{
123+
Title: "Icon", // name of field to show in UI
124+
Name: "icon", // name of field that will be included in the iconHandlerFields map
125+
Type: "File" // type of input to show on streamdeckui, options are Text, File, TextAlignment, and Number
126+
FileTypes: []string{".png", ".jpg"} // Allowed file types if a File input type is used
127+
}
128+
},
129+
KeyFields: []api.Field{}, // Same as IconFields
130+
}
131+
}
91132

92-
#### Icon Handler
133+
```

0 commit comments

Comments
 (0)