x4121 / tmux-slack-counter

Tmux indicator to show mentions and messages from slack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tmux slack counter

Plugin that displays counters for mentions and messages in slack so you can keep TMUX in fullscreen.

Usage

Generate a token for the slack API and store it in $TMUX_PLUGIN_MANAGER_PATH/tmux-slack-counter/token.

Add #{slack_dms}, #{slack_mentions} and #{slack_messages} to your status-right.

set -g status-right 'Slack: #{slack_dms}/#{slack_mentions}/#{slack_messages} | %a %Y-%m-%d %H:%M'

screenshot

Variables

  • #{slack_dms}: All direct messages for you (without group chats)
  • #{slack_mentions}: All mentions in group chats, groups and channels that are not archived
  • #{slack_messages}: All messages in group chats, groups and channels that are not archived or muted

Delay

The default minimum delay between API requests is 1 minute. This doesn't affect the status-interval of tmux, just how often the API can be queried. You can change this value by setting @slack_update_delay in your .tmux.conf.

set -g @slack_update_delay '5 minutes'

Installation

Requirements

Installation with Tmux Plugin Manager (recommended)

Add plugin to the list of TPM plugins in .tmux.conf:

set -g @plugin 'x4121/tmux-slack-counter'

Hit prefix + I to install it.

Manual Installation

Clone the repo:

$ git clone https://github.com/x4121/tmux-slack-counter.git ~/clone/path

Add this line to the bottom of your .tmux.conf:

run-shell ~/clone/path/tmux-slack-counter.tmux

Reload TMUX environment with:

$ tmux source-file ~/.tmux.conf

Errors

#{slack_dms}, #{slack_mentions} and #{slack_messages} either return numbers or error codes. These are:

  • TOK: There is no token file or it is empty (see Usage)
  • AUTH: The token seems to be invalid. You may test it against the slack API web interface.
  • ? or X? where X is a number: The request failed, you might be offline.
  • NO_JQ: You don't have jq installed.
  • ERR: Something else failed. The plugin will stop sending API requests until you remove the file err in the plugin directory. This is to prevent the plugin from spamming the API with invalid requests. The file err contains the last result from the failed request.

Other plugins

You might also find these useful:

  • maildir-counter - Plugin that counts files on a specific mail directory
  • online-status - Tmux plugin that displays online status of your computer.

License

MIT

About

Tmux indicator to show mentions and messages from slack

License:MIT License


Languages

Language:Shell 100.0%