github-api-streamdeck-plugin
github-api-streamdeck-plugin copied to clipboard
GitHub API Plugin for the Elgato Stream Deck
GitHub API Plugin for the Elgato Stream Deck
Show data from GitHub's API.
Usage
- Generate a GitHub personal access token (you can allow only the scopes required for your query)
- Put the token under "GitHub Access Token" in the settings
- Select one of the presets and modify the settings to your liking
Settings Documentation
GitHub Access Token
Log into your GitHub account and generate an access token with the proper permissions.
GraphQL Query
The GraphQL query that will be sent to GitHub's API. The query will be refetched in the background every 60 seconds and after every settings change.
Useful links:
Badge
Optionally show a counter in the bottom-right corner. Used for 1-2 digit numbers, won't work well with texts.
Value pathis the path to the value in the query response (Uses Lodash's get() syntax). The value will always be cast to a string.Show conditionis a JavaScript expression which should resolve to a boolean. For example, the condition!== "0"will not show the badge if the value is"0". This is basically what happens under the hood:
eval(`${badgeValue} ${badgeCondition};`)
Status Colors
Control the color of the icon depending on the query response.
Value path- same as the badge value pathColors dictionaryis a JSON dictionary. The special values aredefaultanderror, and the rest are the status values:
{
"default": "#aa9900",
"error": "#ff3333",
"0": "#66ff66",
"any-other-value-that-can-be-returned": "#666666"
}
On Press
What should happen after pressing the Stream Deck button:
Re-fetch datawill send the query immediatellyOpen First URLwill find the first URL value in the response and open it in your browserOpen All URLswill open all URL values in the response in your browser
Presets
Pull requests to review
Shows the number of pull requests you were requested to review. If you have at least 1 PR, the background will be yellow. Pressing the button will open the first 5 PRs.

My pull requests
Shows the number of open pull requests you're the author of. If you have at least 1 failing PR, the background will be yellow. Pressing the button will open the first 5 PRs.

Repository status
Shows the status of the last commit on the default branch of a repository (edit the repo owner/name fields in the query). The background will be red on error/failure, yellow on pending, and green on success/expected. Pressing the button will open the first associated PR of the commit.

Development
- Create a symlink from the
dist/directory to the plugins directory:
ln -s $(pwd)/dist ~/Library/Application\ Support/com.elgato.StreamDeck/Plugins/com.github.guyb7.github-api-streamdeck-plugin.sdPlugin
- Build the plugin:
npm run build
- Reload the Stream Deck application, and then the app will be available under "Custom > GitHub API"
To debug:
- Run
defaults write com.elgato.StreamDeck html_remote_debugging_enabled -bool YES - Reload the Stream Deck application
- Open http://localhost:23654/
Publish
- Bump version
cd ~/Library/Application Support/com.elgato.StreamDeck/Plugins./DistributionTool -b -i com.github.guyb7.github-api-streamdeck-plugin.sdPlugin -o ~/Desktop- Email
[email protected]with release notes