Giter Site home page Giter Site logo

tmux-slack-counter's Introduction

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

tmux-slack-counter's People

Contributors

chriszarate avatar x4121 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.