Update Slack Status using Stream Deck without an API Key

header

Intro

Here’s how you can automatically set your Slack status using a Stream Deck. This method of setting your Slack statusg does not use the Slack API.

This method uses Slack deep links to open the Slack app to your personal profile page and then uses text and hotkeys to set your status. This means that this method will execute in the foreground.

A deep link looks like your typical URL, e.g., https://, but instead of https, the name of the app is typically used instead.

Many apps have their own deep links. Slack’s deep links start with slack://

Each “set status” Slack macro takes about 1.8 seconds to fully execute on an Apple M1 Pro machine.

POC

poc

Disclaimers

This method with not work if you:

  1. Close Slack while a macro is executing.
  2. Click your mouse away from Slack while a macro is executing.
  3. Don’t have Slack open while a macro is executing (who doesn’t have Slack open all the time anyway?). Slack can’t open fast enough to catch up with the macro.

Setup

There are two components to the Slack deep link that opens your profile page.

To find each one, follow the instructions below:

Team ID

  1. Open any web browser and log into your Slack account.
  2. Go to your workspace main page and check the URL in the search bar at the top.
  3. The URL should start like this: https://app.slack.com/client/T
  4. The team ID is the section of the URL beginning with T. Example:

teamid

Member ID

This one is unique to you. You can get it from the “Copy member ID” link on the drop down in your personal Slack profile page:

memberid

Now that you have the Team ID and Member ID, you can start with the first Stream Deck action.

To start, add a Multi Action to a Stream Deck page and open up the configuration.

multiaction

action1

  1. The first action should be “System: Website”. The URL should be: slack://user?team=YOUR_TEAM_ID&id=YOUR_MEMBER_ID. Fill in the YOUR_TEAM_ID and YOUR_MEMBER_ID values with the ones that you gathered earlier. Leave the GET request in background option unchecked.

action2

  1. The second action should be “System: Text”. The text should be /. This is just to open the Slash commands menu. Leave the Press Enter after message option unchecked.clear

action3

  1. The third action should be “System: Text”. This is where you customize your Slack status. For this example, the text should be: status 🧠 deep work; may be slow to respond. This will set a status with a 🧠 emoji that says “deep work; may be slow to respond”. Leave the Press Enter after message option unchecked.

action4

If you want some more ideas on mindful Slack statuses, Michael Soo Lee has a great blog post about this here.

action5

  1. The fourth action should be “System: Hotkey” with the Enter key as the hotkey.

action6

  1. The fifth action should be another “System: Hotkey” with the Enter key as the hotkey. This is to account for input lag at this last step.

Done!

In a perfect world, the last 3 commands could all be combined together; however, there is a degree of input lag that doesn’t allow the commands to be executed quickly enough. This may be because Slack is built on Electron and a native app would be faster to execute the commands together.

Future Considerations

The best future case for these types of automations is for them to be able to run in the background without an API key. It would be best to switch over to that method if Slack or some emboldened person ever makes this available.

The second best option would be if Slack adds the ability to tack on a body to the deep link and send it as a message directly to a user. This would make this process a bit more streamlined.

Overall, I am happy with this method and it has been working well for me since I started using it.

Configuration Screenshots (if needed)

mtu config1

config2

config3

config4

config5