DEV Community

Cover image for Displaying GitHub information on Elgato Streamdeck
Emanuele Bartolesi
Emanuele Bartolesi

Posted on

Displaying GitHub information on Elgato Streamdeck

A few weeks ago I wrote about using Elgato with Microsoft Teams.
I have the Elgato Streamdeck since many years right now and time to time I tried to optimize the usage with plugins and shortcuts.

In this article I will help you to configure the Streamdeck to display some information about your GitHub account.

First of all, please update the Stream Deck application to the latest version.
After that, navigate to the Plugins menu inside the application.

Stream Deck

Search for "GitHub API" and install the plugin.

Now, in the main Stream Deck application window, you can see the new plugin in the list.

GitHub API plugin

Drag and drop the only one action available in a free key on the Stream Deck.
To interact with GitHub, you need a personal access token.
Navigate here and create a new one just for the Stream Deck application.
You can select the minimum permissions that you need for security reasons.

In the text area below the token, you can add a GraphQL query to retrieve the information you want to display in the key.
For instance, the next query, display the total contributions in the last year.

query {
  user(login: "kasuken") {
    contributionsCollection {
      contributionCalendar {
        totalContributions
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

This is how the key configuration looks like:

Key Configuration

To create new queries, I suggest to use GraphQL API explorer directly from the GitHub website: https://docs.github.com/en/graphql/overview/explorer

By scrolling down the key configuration screen, you can access to additional settings as the value you want to display in the key and the background color of the key, based on this value.

colors

In the picture above you can see some values from a key on my Stream Deck.

My Queries

I share with you the query I use for my four buttons:

Contributions in the last year

query {
  user(login: "kasuken") {
    contributionsCollection {
      contributionCalendar {
        totalContributions
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

value path: user.contributionsCollection.contributionCalendar.totalContributions


Followers

query {
user(login: "kasuken") {
  followers {
    totalCount
  }
}
Enter fullscreen mode Exit fullscreen mode

value path: user.followers.totalCount


My Issues

{
  myOpenPrs: search(query: "type:issues author:kasuken is:open archived:false", type: ISSUE, first: 100) {
    issueCount
     edges {
        node {
          ... on Issue {
          title
          state
          url
        }
      }
    }    
  }
}
Enter fullscreen mode Exit fullscreen mode

value path: myOpenPrs.issueCount


My PR

{
myOpenPrs: search(query: "type:pr author:@me is:open archived:false", type: ISSUE, first: 5) {
issueCount
edges {
node {
... on PullRequest {
title
mergeable
state
url
}
}
}
}
openPrsWithError: search(query: "type:pr author:@me is:open status:failure", type: ISSUE) {
issueCount
}
}
value path: myOpenPrs.issueCount


Thanks for reading this post, I hope you found it interesting!

Feel free to follow me to get notified when new articles are out 🙂

Top comments (2)

Collapse
 
kathodion profile image
Pascal Odermatt

could you add a pic how the streamdeck looks now?

Collapse
 
kasuken profile image
Emanuele Bartolesi

It's the picture in the banner.
I will upload the image without effects at the end of the blog post