Skip to content

Makes you appear active on Slack, even when you are not😉

Notifications You must be signed in to change notification settings

smaugfm/slack-presence

Repository files navigation

slack-presence

Makes you appear active on Slack, even when you are not😉

Runs in a Docker container, so you can self-host it or host in the cloud.
Uses Pushover notifications to alert you when you start & stop appearing online.

Getting started

You will need Docker installed on your system. For the initial setup follow these steps:

  1. Get the default docker-compose.yml and place it somewhere on your machine. In that folder slack-presence will create chrome folder with internal Chrome user data and options.json with slack-presence settings.

  2. Change TZ=Europe/Kiev in the docke-compose.yml file to your local timezone.

  3. Run the following command in the workfolder where you placed docker-compose.yml

    docker-compopse up -d
  4. Visit http://localhost:9333 and:

    • Enter your Slack workspace URL.
    • Optionally change online appearance schedule, or leave the default 9am to 6pm.
    • Enable Slack-presence
  5. For the first time you will have to manually login to your Slack workspace within internal browser. Wait for the message to appear and then follow instructions.

  6. You are good to go! You now appear as Active on Slack from Monday till Friday by your selected schedule.

  7. Optional. Setup Pushover notifications.

From time to time your Slack login session will expire and you will have to re-login manually.

Pushover notifications

Slack-presence can notify you via Pushover when you start/stop appearing online, when your Slack login session has expired or when something went wrong. I personally also use this feature as a reminder to start/end my workday🙂.

To setup Pushover you have to create an account there and obtain two keys:

  • Your User Key (example: zLkWytJOeiuBFambEOTHCuTYJCbwTJ)
  • Your API Token/Key (example: bfRUJGNjsFxJSlYkDlMYdSFXuewHjT)

Update your docker-compose.json with your keys (I used example keys here):

- PUSHOVER_USER_KEY=zLkWytJOeiuBFambEOTHCuTYJCbwTJ
- PUSHOVER_API_TOKEN=bfRUJGNjsFxJSlYkDlMYdSFXuewHjT

Then restart slack-presence:

docker-compose restart

How does it work

There are several approaches to make Slack believe that you are active:

  1. Actually being active (too hard, boring)
  2. Always open Slack on a smartphone with sleep turned off (requires a separate smartphone)
  3. Mouse jiggler with a desktop app (unreliable, requires a dedicated PC with a GUI)
  4. Slack API (no longer works)
  5. Third-party (usually paid and proprietary) services, like this one.
  6. Selenium (or simiar) tool to drive a Slack web browser tab.

This tool uses approach #6 as the most reliable and consistent one. It's basically like #1, but automated. It uses Puppeteer to start and drive a headless (with no graphical UI but full-featured) Chrome instance which logs in to Slack web app at your provided workspace URL and then periodically refreshes the page to make you appear active. As slack uses two-factor authentication and captcha you have to login to Slack web manually for the first time (and then from time to time when login session expires) but fortunately Chrome DevTools Protocol allows you to remotely connect to a headless Chrome and do all the work in a nice way.

About

Makes you appear active on Slack, even when you are not😉

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published