{"id":16965301,"url":"https://github.com/magicmonkey/go-streamdeck","last_synced_at":"2025-03-17T08:37:46.906Z","repository":{"id":43831399,"uuid":"263768543","full_name":"magicmonkey/go-streamdeck","owner":"magicmonkey","description":"Go interface to an Elgato Streamdeck","archived":false,"fork":false,"pushed_at":"2024-02-12T16:20:42.000Z","size":104,"stargazers_count":75,"open_issues_count":8,"forks_count":23,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-27T21:39:43.870Z","etag":null,"topics":["elgato","elgato-stream-deck","golang","streamdeck"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magicmonkey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-13T23:42:38.000Z","updated_at":"2025-02-27T17:04:52.000Z","dependencies_parsed_at":"2024-06-18T18:11:50.074Z","dependency_job_id":"f2d91222-c282-4388-9e81-c784b760bbcc","html_url":"https://github.com/magicmonkey/go-streamdeck","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicmonkey%2Fgo-streamdeck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicmonkey%2Fgo-streamdeck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicmonkey%2Fgo-streamdeck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicmonkey%2Fgo-streamdeck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magicmonkey","download_url":"https://codeload.github.com/magicmonkey/go-streamdeck/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243852499,"owners_count":20358271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elgato","elgato-stream-deck","golang","streamdeck"],"created_at":"2024-10-13T23:45:37.732Z","updated_at":"2025-03-17T08:37:46.519Z","avatar_url":"https://github.com/magicmonkey.png","language":"Go","readme":"# Go Streamdeck\n\nA Go interface to an Elgato Streamdeck (currently works with the 32-button XL only because that's what I have).\n\n[![GoDoc](https://godoc.org/github.com/magicmonkey/go-streamdeck?status.svg)](https://godoc.org/github.com/magicmonkey/go-streamdeck)\n\n_Designed for and tested with Ubuntu, Go 1.13+ and a Streamdeck XL. Images are the wrong size for other streamdecks; bug reports and patches are welcome!_\n\n- [Installation](#installation)\n- [Usage](#usage)\n  * [Example high-level usage](#example-high-level-usage)\n  * [Example low-level usage](#example-low-level-usage)\n- [Showcase](#showcase)\n- [Contributions](#contributions)\n\n## Installation\n\nEither include the library in your project or install it with the following command:\n\n```\ngo get github.com/magicmonkey/go-streamdeck\n```\n\nOn Linux, you might also need to add some `udev` rules.  Put this into `/etc/udev/rules.d/99-streamdeck.rules`:\n```\nSUBSYSTEM==\"usb\", ATTRS{idVendor}==\"0fd9\", ATTRS{idProduct}==\"0060\", MODE:=\"666\"\nSUBSYSTEM==\"usb\", ATTRS{idVendor}==\"0fd9\", ATTRS{idProduct}==\"0063\", MODE:=\"666\"\nSUBSYSTEM==\"usb\", ATTRS{idVendor}==\"0fd9\", ATTRS{idProduct}==\"006c\", MODE:=\"666\"\nSUBSYSTEM==\"usb\", ATTRS{idVendor}==\"0fd9\", ATTRS{idProduct}==\"006d\", MODE:=\"666\"\nSUBSYSTEM==\"usb\", ATTRS{idVendor}==\"0fd9\", ATTRS{idProduct}==\"0080\", MODE:=\"666\"\nSUBSYSTEM==\"usb\", ATTRS{idVendor}==\"0fd9\", ATTRS{idProduct}==\"0090\", MODE:=\"666\"\n```\n\n## Usage\n\nThere are 2 ways to use this: the low-level \"comms-oriented\" interface (using `streamdeck.Open`) which wraps the USB HID protocol, or the higher-level \"button-oriented\" interface (using `streamdeck.New`) which represents buttons and actions.\n\nIf you want to implement your own actions, I suggest that you either instantiate a `CustomAction` or alternatively implement the `ButtonActionHandler` interface (basing your code on the `CustomAction`).\n\n### Example high-level usage\n\nHigh level usage gives some helpers to set up buttons. This example has a few things to look at:\n\n* A button in position 2 that says \"Hi world\" and prints to the console when pressed\n\n* A button in position 7 displaying the number 7 - changes to number 8 when pressed.\n\n* A yellow button in position 26\n\n* A purple button in position 27, it changes colour _and_ prints to the console when pressed.\n\n```go\nimport (\n\t\"image/color\"\n\t\"time\"\n\n\tstreamdeck \"github.com/magicmonkey/go-streamdeck\"\n\t\"github.com/magicmonkey/go-streamdeck/actionhandlers\"\n\t\"github.com/magicmonkey/go-streamdeck/buttons\"\n\t_ \"github.com/magicmonkey/go-streamdeck/devices\"\n)\n\nfunc main() {\n\tsd, err := streamdeck.New()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// A simple yellow button in position 26\n\tcButton := buttons.NewColourButton(color.RGBA{255, 255, 0, 255})\n\tsd.AddButton(26, cButton)\n\n\t// A button with text on it in position 2, which echoes to the console when presesd\n\tmyButton := buttons.NewTextButton(\"Hi world\")\n\tmyButton.SetActionHandler(\u0026actionhandlers.TextPrintAction{Label: \"You pressed me\"})\n\tsd.AddButton(2, myButton)\n\n\t// A button with text on it which changes when pressed\n\tmyNextButton := buttons.NewTextButton(\"7\")\n\tmyNextButton.SetActionHandler(\u0026actionhandlers.TextLabelChangeAction{NewLabel: \"8\"})\n\tsd.AddButton(7, myNextButton)\n\n\t// A button which performs multiple actions when pressed\n\tmultiActionButton := buttons.NewColourButton(color.RGBA{255, 0, 255, 255})\n\tthisActionHandler := \u0026actionhandlers.ChainedAction{}\n\tthisActionHandler.AddAction(\u0026actionhandlers.TextPrintAction{Label: \"Purple press\"})\n\tthisActionHandler.AddAction(\u0026actionhandlers.ColourChangeAction{NewColour: color.RGBA{255, 0, 0, 255}})\n\tmultiActionButton.SetActionHandler(thisActionHandler)\n\tsd.AddButton(27, multiActionButton)\n\n\ttime.Sleep(20 * time.Second)\n}\n```\n\nThe program runs for 20 seconds and then exits.\n\n### Example low-level usage\n\nThe low-level usage gives more control over the operations of the streamdeck and buttons.\n\nThis example shows an image on any pressed button, updating each time another button is pressed.\n\n```go\nimport streamdeck \"github.com/magicmonkey/go-streamdeck\"\n\nfunc main() {\n\tsd, err := streamdeck.Open()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tsd.ClearButtons()\n\n\tsd.SetBrightness(50)\n\n\tsd.ButtonPress(func(btnIndex int, sd *streamdeck.Device, err error) {\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tsd.ClearButtons()\n\t\tsd.WriteImageToButton(\"play.jpg\", btnIndex)\n\t})\n\n\ttime.Sleep(20 * time.Second)\n\n}\n```\n\nThe program runs for 20 seconds and then exits.\n\n## Showcase\n\nProjects using this library (pull request to add yours!)\n\n* [Streamdeck tricks](https://github.com/lornajane/streamdeck-tricks)\n\n## Contributions\n\nThis is a very new project but all feedback, comments, questions and patches are more than welcome. Please get in touch by opening an issue, it would be good to hear who is using the project and how things are going.\n\nFor more, see [CONTRIBUTING.md](CONTRIBUTING.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicmonkey%2Fgo-streamdeck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagicmonkey%2Fgo-streamdeck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicmonkey%2Fgo-streamdeck/lists"}