Let coworkers know you're busy with Slack and don't want to be interrupted.

Let coworkers know you're busy with Slack

Slack messaging app

Slack is an awesome messaging app for teams. If you're using it at work, wouldn't it be great to integrate it with Focus so you could let your co-workers know when you were available?

With a little work, we can do just that!

Read on to learn how. The following steps can get a little advanced, so if you need help contact [email protected].

Getting setup

We'll be using node-slack-cli an open-source project that lets us control Slack from the command line.

Open /Applications/Utilities/Terminal.app and type:

npm install node-slack-cli -g

This installs the package onto your computer.

Next visit https://api.slack.com/web#auth and under "Authentication" click Create Token next to the team you want to create the token for.

Copy the token for use below.

Tell Slack when you start Focusing

Now you can add the following lines in Preferences > Scripting > Focus

export PATH=$PATH:/usr/local/bin
/usr/local/bin/slack -c general -m "I've started a Focus session" -u YOUR_USERNAME_GOES_HERE

Replace YOUR_TOKEN_GOES_HERE with the token from Slack and YOUR_USERNAME_GOES_HERE with your username.

You can customize the message I've started a Focus session to say whatever you want and change the channel by changing general to whichever channel you want.

These lines, in order, say:

  1. Let Focus know where the node program lives by adding it's directory to our path
  2. Setup the Slack token
  3. Send the command to Slack

That's it. Now you should see something like the following in your Slack channel when you Focus:

Slack chat

Tell Slack when you stop Focusing

To notify a Slack room when you stop Focusing, add the following lines in Preferences > Scripting > Unfocus

export PATH=$PATH:/usr/local/bin
/usr/local/bin/slack -c general -m "I've stopped a Focus session" -u YOUR_USERNAME_GOES_HERE

Replace the same tokens from above, and customize the message and channel if needed.

That's it! Now your coworkers know if it's a good time to bug you or if they should wait until you're done working.

Was this blog post helpful? Yes / No

« Back to Focus Productivity Blog
Posted on July 19, 2015


Drowning in distractions? They're chipping away at your productivity and focus. Fight back with Focus, the macOS app designed to block distractions and keep you on track. Regain your focus, achieve your goals, and find balance. Give Focus a try and see the difference it makes!

Download Focus
Try Focus free for 7-days!