Tmux plugin to show telegram unread dialogs and messages count in status bar as a widget.
The main difference from the older Tmux Telegram Unread plugin is that the telegram-cli have to be started as a daemon or with the defined port (we look at 2391 by default):
$ telegram-cli -P 2391
It fixes a TG CLI bug with stolen new messages, so this plugin is recommended. We use netcat to get info.
You able to use Tmux Telegram Pager instead of TG CLI daemon.
Put #{telegram_unread} in status bar to get the plugin message.
Example:
set -g status-right "#[fg=colour39]Tg: #{telegram_unread} #[fg=yellow] | %a %d-%h-%y %H:%M "
You can configure plugin messages format, specify the port of telegram-cli instance and netcat timeout.
-
Set plugin message format in
.tmux.conf
:set -g @telegram-unread-message "@telegram_dialogs_unread : @telegram_messages_unread"
Params names say for themselves
-
You can set shorter message string for unavailable TG CLI at the defined port ("No Telegram at @port" is by default)
set -g @telegram-no-daemon-message 'no tg'
-
Set telegram-cli port with the setting in
.tmux.conf
:set -g @telegram-daemon-port '2391'
-
Set netcat connection timeout (in seconds). Try it only if something doesn't work:
set -g @telegram-daemon-timeout '1'
Depends on
- Telegram CLI
- nc (netcat)
Update time depends on status-interval option
Installation with Tmux Plugin Manager (recommended)
Add plugin to the list of TPM plugins in .tmux.conf
:
set -g @tpm_plugins ' \
tmux-plugins/tpm \
newvar/tmux-telegram-daemon-unread \
'
Hit prefix + I
to fetch the plugin and source it. You should now be able to
use the plugin.
Clone the repo:
$ git clone https://github.com/newvar/tmux-telegram-daemon-unread ~/clone/path
Add this line to the bottom of .tmux.conf
:
run-shell ~/clone/path/tmux-telegram-daemon-unread.tmux
Reload TMUX environment:
# type this in terminal
$ tmux source-file ~/.tmux.conf
You should now be able to use the plugin.
Inspired by Tmux CPU Plugin
MIT