Plugin that displays counters for mentions and messages in slack so you can keep TMUX in fullscreen.
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'
#{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
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'
Add plugin to the list of TPM plugins in .tmux.conf
:
set -g @plugin 'x4121/tmux-slack-counter'
Hit prefix + I
to install it.
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
#{slack_dms}
, #{slack_mentions}
and #{slack_messages}
either
return numbers or error codes. These are:
TOK
: There is notoken
file or it is empty (see Usage)AUTH
: The token seems to be invalid. You may test it against the slack API web interface.?
orX?
whereX
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 fileerr
in the plugin directory. This is to prevent the plugin from spamming the API with invalid requests. The fileerr
contains the last result from the failed request.
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.