A simple shell script to update your status in slack from the command line, based on presets you provide in a configuration file.
Copy slack_status.sh
to somewhere in your path.
Before you can use this, you need to add the status updater as a new slack app. To do this:
- Go to https://api.slack.com/apps/new to create a new app
- Choose a name for the new app: Slack status updater
- Select your workspace from the "Development Slack Workspace" dropdown
- This will bring you to the app configuration section, choose "OAuth and Permissions" from the sidebar on the left under the "Features" section.
- Scroll down until you see "User token scopes" and click "Add an OAuth scope"
- Type in
users.profile:write
and select it from the menu. - If you want to use the
awayback.sh
script that's also in this repository, add theusers:write
scope as well. - Scroll back to the top and click the "Install App to Workspace" button.
- You will be brought to a screen asking you to allow the app access. Click "Allow"
- You will be taken back to a screen containing an access token starting with
xoxp-
. Click the "Copy" button to copy this to the clipboard.
Once you have the token, run slack_status.sh setup
and follow the prompts.
This will create a configuration file for you.
If you wish, edit the config file to add additional presets.
slack_status.sh PRESET
- updates your slack status to the presetslack_status.sh none
- resets your slack status to be blankslack_status.sh PRESET ADDITIONAL TEXT
- any additional text you type will be added to the end of your slack status.
Example:
$ slack_status.sh test
Updating status to: :check: Testing status updater
$ slack_status.sh none
Updating status to:
$ slack_status.sh vacation
Updating status to: :hotel: On vacation
$ slack_status.sh vacation until June 15
Updating status to: :hotel: On vacation until June 15
There is a helper script for hammerspoon that will automatically set your status appropriately when you are in a zoom meeting.
To install it:
- Install and set up the slack_status.sh script (make sure it's in your path)
- Ensure there is a 'zoom' preset (one is created by default during setup)
- Install hammerspoon (brew cask install hammerspoon) if you don't have it already.
- Copy the
zoom_detect.lua
file to ~/.hammerspoon/ - Add the following line to ~/.hammerspoon/init.lua:
local zoom_detect = require("zoom_detect")
There is an alfred workflow in helpers/alfred to let you quickly update your slack status from within alfred. See the README in that directory for more information on using it.