Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chriszarate/SlackNotifier.spoon
Show unread Slack DMs and mentions via Hammerspoon
https://github.com/chriszarate/SlackNotifier.spoon
Last synced: 3 months ago
JSON representation
Show unread Slack DMs and mentions via Hammerspoon
- Host: GitHub
- URL: https://github.com/chriszarate/SlackNotifier.spoon
- Owner: chriszarate
- Created: 2020-05-03T19:18:32.000Z (over 4 years ago)
- Default Branch: trunk
- Last Pushed: 2024-01-06T18:23:59.000Z (10 months ago)
- Last Synced: 2024-07-21T00:35:35.669Z (4 months ago)
- Language: Lua
- Size: 11.7 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Hammerspoon Slack notifier
Check the Slack API periodically and provide a count of unread DMs and mentions
in a menubar app. Click on the menubar icon to snooze.![screenshot](https://zthings.files.wordpress.com/2020/02/screen-shot-2020-02-09-at-11.17.33-pm.png)
## Loading the spoon
Clone this repo in `~/.hammerspoon/Spoons/`. (After doing so, the path to this
readme should be `~/.hammerspoon/Spoons/SlackNotifier.spoon/readme.md`.Now load the spoon from your Hammerspoon config:
```lua
hs.loadSpoon('SlackNotifier')
spoon.SlackNotifier:start({
cookieToken = "xoxd-xxxx",
workspaceToken = "xoxc-xxxx",
})
```# Configuration
- `interval`: Interval in seconds to refresh the menu (default 60)
- `cookieToken`: Token found in your cookies when authenticated against your Slack workspace in the browser (required)
- Using Chrome devtools, go to Application > Cookies > https://app.slack.com
- Copy the value for `d`. It should start with `xoxd-`.
- If it contains URL-encoded characters (`%..`), you will need to URL-decode it: `copy( encodeURIComponent( 'token' ) )`.
- `workspaceToken`: Token found in request payload when authenticated against your Slack workspace in the browser (required).
- Using Chrome devtools, go to Network, reload the page, and filter for `slack.com/api/`, select a `POST` request, and click the Payload tab.
- Look for `token` in the payload. It should start with `xoxc-`.