AKovalevich / streamdeck

Golang API for the Corsair / Elgato StreamDeck

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

streamdeck

Go Report Card MIT licensed GoDoc

streamdeck buttons streamdeck slide show

streamdeck is a library for interfacing with the Elgato Stream Deck

This library is written in the programing language Go.

Note

This project is a golang API for the Elgato/Corsair StreamDeck. This library unleashes the power of the StreamDeck. It allows you to completely customize the content of the device, without the need of the OEMs software.

License

streamdeck is published under the permissive MIT license.

Dependencies

There are a few go libraries which are needed at compile time. streamdeck does not have any runtime dependencies.

However compiling this library requires a c compiler since the underlying HID library requires cgo for enumerating the HID devices.

Supported Operating Systems

In principal the library should work on Linux, MacOS and Windows (>=7).

streamdeck works well on SoC boards like the Raspberry / Orange / Banana Pis.

How to Install

$ go get github.com/dh1tw/streamdeck

By default the images and fonts are not included in the binary. If you would like to do so, you can execute:

$ go get github.com/gobuffalo/packr/v2/packr2
$ cd $GOPATH/src/github.com/dh1tw/streamdeck
$ packr2

Packr2 will compile all the static assets into go file while will then be included when you execute go build.

On Linux you might have to create an udev rule, to access the streamdeck.

sudo vim /etc/udev/rules.d/99-streamdeck.rules

SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0060", MODE="0664", GROUP="plugdev"

After saving the udev rule, unplug and plug the streamdeck again into the USB port. For the rule above, your user must be a member of the plugdev group.

Make sure that your streamdeck is correctly recognized by executing:

$ go run examples/enumerate.go
Found 1 Elgato Stream Deck(s):
	SerialNumber:        AL12H1A07123

Documentation

The auto generated documentation can be found at godoc.org

Examples

There are a couple of examples located in the examples folder.

$ go run examples/led_buttons.go
$ go run examples/slideshow.go
...

Credits

This project would not have been possible without the work of Alex Van Camp. In particular his notes of the StreamDeck's protocol were very helpful. Alex has provided a reference implementation in Javascript / Node.js.

About

Golang API for the Corsair / Elgato StreamDeck

License:MIT License


Languages

Language:Go 100.0%