Giter Club home page Giter Club logo

streamdeck-plugin-template's Introduction

Stream Deck Plugin Template

The Stream Deck Plugin Template is a template to let you get started quickly when writing a JavaScript plugin for Stream Deck. Stream Deck Plugin Template requires Stream Deck 6.0 or later.

Description

Stream Deck Plugin Template is a complete plugin that shows you how to

  • load and save settings using Stream Deck's persistent store
  • setup and communicate with the Property Inspector
  • pass messages directly from Property Inspector to the plugin (and vice versa)
  • localize your Property Inspector's UI to another language

Features

  • code written in Javascript
  • cross-platform (macOS, Windows)
  • localization support
  • styled Property Inspector included
  • Property Inspector contains all required boilerplate code to let you instantly work on your plugin's code.

Quick Start Guide

A short guide to help you get started quickly.

Clone the repo

git clone https://github.com/elgatosf/streamdeck-plugin-template

Replace Name

Rename the folder as well as any references.

com.elgato.template.sdPlugin with my.domain.plugin-name.sdPlugin

Important

When sym-linking the plugin, the folder name must end with .sdPlugin.

Get the latest library

You can either clone the javascript library or add it as a submodule to your repository.

Clone

git clone https://github.com/elgatosf/streamdeck-javascript-sdk src/my.domain.plugin-name/libs

Add Submodule

git submodule add https://github.com/elgatosf/streamdeck-javascript-sdk src/my.domain.plugin-name/libs

Start Coding

You can get started in app.js!

const myAction = new Action('com.elgato.template.action');

/**
 * The first event fired when Stream Deck starts
 */
$SD.onConnected(({ actionInfo, appInfo, connection, messageType, port, uuid }) => {
  console.log('Stream Deck connected!');
});

myAction.onKeyUp(({ action, context, device, event, payload }) => {
  console.log('Your key code goes here!');
});

myAction.onDialRotate(({ action, context, device, event, payload }) => {
  console.log('Your dial code goes here!');
});

streamdeck-plugin-template's People

Contributors

chektek avatar geekyeggo avatar mikebirdtech avatar tiptronic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

streamdeck-plugin-template's Issues

Documentation / Readme

Hello,

I found this project and am trying to reverse engineer how to run it right now. This is probably trivial for anyone who develops plugins for the stream deck, but I have no such experience.

I bet I will have figured it out by the time anyone replies, but its just a suggestion to write a quick start guide. Nothing fancy, just how do you run it.

I'll also be trying to extend this project to change the source on the AVR which would be my main use-case. If successful, I'll raise a PR.

Are install instructions accurate?

I followed the exact steps in the README.md but the plugin doesnt show up on the Elgato Stream Deck.app on my macbook. I see old versions needed the DestributionTool, is this still the case? How can I debug this? I am not sure if restarting the Stream Deck application is enough to get the plugin to show.

fatal: No url found for submodule path 'src/com.elgato.template.sdPlugin/libs' in .gitmodules

Following the quick start guide, I got a 'fatal: No url found for submodule path 'src/com.elgato.template.sdPlugin/libs' in .gitmodules'.

Step to reproduce:

% git clone https://github.com/elgatosf/streamdeck-plugin-template
Cloning into 'streamdeck-plugin-template'...
remote: Enumerating objects: 362, done.
remote: Counting objects: 100% (79/79), done.
remote: Compressing objects: 100% (33/33), done.
remote: Total 362 (delta 57), reused 50 (delta 46), pack-reused 283
Receiving objects: 100% (362/362), 267.59 KiB | 4.69 MiB/s, done.
Resolving deltas: 100% (197/197), done.
% mv streamdeck-plugin-template/ test
% cd test
% mv src/com.elgato.template.sdPlugin/ src/dk.wetendorff.test.sdPlugin
% find . -type f \( -path './.*' -not -name '.gitmodules' -prune -o -name 'action.sketch' -prune -o -print \) | xargs sed -i '' 's/com.elgato.template/dk.wetendorff.test/g'

% git submodule init && git submodule update
fatal: No url found for submodule path 'src/com.elgato.template.sdPlugin/libs' in .gitmodules

Workaround (instead of 'git submodule init && git submodule update'):**

% rm -rf src/dk.wetendorff.test.sdPlugin/libs/
% git submodule add https://github.com/elgatosf/streamdeck-javascript-sdk src/dk.wetendorff.test.sdPlugin/libs/

System:

macOS Ventura 13.3
git 2.40.0

Translations not working at all

The 'Localization' key/section inside the localization json doesn't work. This worked with the old pi-samples libraries, but not with the new ones.

{
 ....
  "Localization": {
    "More info": "More info",
    "Message": "Message",
    "Click Me": "Click Me",
    "Button": "Button"
  }
}

myAction.onKeyUp won't work

I did not change much onConnected works but the onKeyUp won't do anything. Also linking the project into the plugin folder won't work as expected. I can't see the plugin in the stream deck then. Only with DistributionTool i can see it

/// <reference path="libs/js/action.js" />
/// <reference path="libs/js/stream-deck.js" />

const myAction = new Action('ch.sohneg.server-manager');

/**
 * The first event fired when Stream Deck starts
 */
$SD.onConnected(({ actionInfo, appInfo, connection, messageType, port, uuid }) => {
	console.log('Stream Deck connected!');
});

myAction.onKeyUp(({ action, context, device, event, payload }) => {
	console.log('Your key code goes here!');
});

myAction.onDialRotate(({ action, context, device, event, payload }) => {
	console.log('Your dial code goes here!');
});

setGlobalSettings Not Working As Expected on Windows 11

Hi,

I am successfully using the setSettings / getSettings to save actions however I am unable to use the setGlobalSettings/getGlobalSettings in a similar manner. I can confirm that the onDidReceiveGlobalSettings event is being fired and there are no Streamdeck log entries (%AppData%/Elgato/StreamDeck/logs) that indicate the request was not accept.

Any help would be appreciated.

The following is an extract of the code I am using in the property inspector for the custom plugin:

const globalSettings = $PI.getGlobalSettings();
.
.
Utils.setFormValue(globalSettings, formGlobalSettings);
.
.
formGlobalSettings.addEventListener(
        'input',
        Utils.debounce(150, () => {
            const value = Utils.getFormValue(formGlobalSettings);
            $PI.setGlobalSettings(value);
        })
    );

Thanks in advance!
M.

Create a template with a module bundler

The dev experience when developing a Streamdeck plugin is really bad.
I would have expected a proper module bundler like rollup to be setup, or a vite plugin.
Is this something you are planing to do ?

set title not working

hey, i'm on my first plugin, and i need set a new title

i try with these options but none work

myAction.onKeyDown(({ action, context, device, event, payload }) => { 
   $SD.send(context, Events.setTitle, { title: "testing title" }); 
   $SD.setTitle(context, "testing title");
   ...

How do I get settings in inspector.js?

I'm almost done with my first plugin, but there's still an issue:

When I close and reopen the Property Inspector, the data from the input fields obviously disappears.

I allready can get the settings in the app.js, when I open the Property inspector, via the onPropertyInspectorDidAppear method:

myAction.onPropertyInspectorDidAppear(({action, context, device, event}) => { $SD.getSettings(context); });

$SD.onDidReceiveSettings('de.nas-max.test.action', (jsn) => { console.log(jsn); });

So, how can I get the settings in the inspector.js, or how can I send a JSON element (in this context the settings) from app.js to inspector.js?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.