Set your status on Slack based on the WiFi network you are connected to (with a few adjustments 🤓).
The script checks periodically the WiFi network name (SSID) you are connected to and sets your status on Slack according to the mapping defined in config.js.
You can additionally set up:
- working hours (and working days) shown in your status
- a predefined AWAY status, which gets switched on outside of your working hours
- to not overwrite your manual statuses
Screenshot example of the Wifi based function:
You need to obtain a Slack token for your account from https://api.slack.com/apps. There you need to do the following:
- "Create New App"
- "From scratch"
- select a name and a workspace and click on "Create App"
- Go to the Section "Add features and functionality" and click on "Permissions"
- Add the following scopes in the section "User Token Scopes":
users.profile.read
users.profile.write
users:write
(since v2.0.0)
- Scroll back up and install the "App" to your workspace
- Now you should be able to see your Token in the section
You also need to have node.js installed to run the script. Currently it works on Windows and macOS only. Install nodejs using this link: https://nodejs.org/en/download/
- Clone or download this repository
- Install dependencies with
npm install
from outside the root directory of the pathy you cloned it to - Copy and paste the token into [config_example.js] slackToken variable
- Rename [config_example.js] -> [config.js]
- Run with
npm start
Be careful with defining a updateInterval value that is too low. Slack will block requests for status change if done too frequently. Run this program as a service (in Windows) using NSSM (the Non Sucking Service Manager) at http://nssm.cc/ Check the Indivirtual blog for more information on how to do this: https://blog.indivirtual.nl/update-slack-status-automatically-using-node-js
Thanks for all previous contributors of the app, this was forked from and gave me the baseline to do the improvements. Thanks to Lukasz Wiktor as well, as it seems his repo was the real baseline: https://github.com/LukaszWiktor/slack-status-based-on-wifi-name
First of all i was missing an option to keep manually set statuses from within Slack, such as Sick/Vacation or Coffee-breaks etc. Thats, why i've implemented a checkup, if the status, that is currently setup, is a manual one. This option can be turned on/off in the config with the new parameter overwriteManualStatus. I also renamed the name of the repo, since the intention is to also plan statuses for the fuuture, like abscences during vacations for the whole year.