slack-status

command module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2020 License: MIT Imports: 13 Imported by: 0

README

Slack Status

Change your presence, status, do not disturb and profile picture settings in multiple Slack workspaces using only one command.

This is a complete re-write of dstokes/slack-status.

Install

Dependencies:

  • Go
  1. Build from source yourself using go:
    go get github.com/greenstatic/slack-status
    
  2. Create your config (see example bellow) in ~/slack-status

Usage

Set your status in Slack.

Running with no arguments will cause your status to be cleared.
When enabling do not disturb (dnd) you must specify a duration.

Source code: https://github.com/greenstatic/slack-status

Usage:
  slack-status [flags]

Flags:
      --away                Set your status as away
  -c, --config string       Config file (default "~/slack-status")
      --dnd                 Set status as do not disturb
  -d, --duration string     Set status duration, units can be: [m,h]. Leave blank for for no expiration
  -e, --emoji string        Emoji to set when setting your status (default ":male-technologist:")
  -g, --group string        Limit setting of status to a group
  -h, --help                help for slack-status
  -m, --message string      Status message
  -p, --profilePic string   Profile picture path (valid formats: jpeg, jpg, png & gif)
  -v, --version             Show version number
  -w, --workspace string    Limit setting of status to a workspace
Examples

Set your custom status to busy working on super secret project:

slack-status -m "busy working on super secret project"

Set your custom status to programming for 45 min and turn on do not disturb for your my_job Slack workspace:

slack-status -m "programming" -d 45m --dnd --workspace my_job

Set your custom status to lectures with custom books emoji for 2h 45m and turn on do not disturb for your work group Slack workspaces:

slack-status -m "lectures" -d 2h45m --dnd --emoji ":books:" -g work

Clears your status and sets it back to Active:

slack-status

Set your custom status to driving and custom car emoji with new profile picture in ~/driving.jpeg:

slack-status -p ~/driving.jpeg -m "driving" --emoji :car:
Configuration

By default slack-status will open ~/slack-status but you can override this behaviour by setting the path to the config explicitly using the `--config flag.

# Example slack-status config
workspaces:
 - name: my_job
   accessToken: "<ACCESS TOKEN>"
   groups:
     - "work"
 - name: home
   accessToken: "<ACCESS TOKEN>"
   groups:
     - "personal"
Acquire Access Token for Workspace

The following instructions outline how to acquire an access token with which slack-status can set your status for a particular Slack workspace.

  1. Visit https://api.slack.com/apps
  2. Click on Create New App. Name the app something like slack-status, select your desired workspace and create your app.
  3. Under the secion Add features and functionality of your app select Permissions. Scroll down to the Scopes section and add the following User Token Scopes:
    • dnd:write
    • users.profile:write
    • users:write
  4. Once your have all the required scopes set, scroll to the top and select Install App to Workspace.
  5. On the redirected page click Allow.
  6. You will get a OAuth Access Token, it should start with xoxp-. This is the access token that you will need for slack-status workspace access token.

You will need to do this for each Slack workspace you wish to specify control using slack-status.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL