Changed bar item buffer_plugin to show plugin name and identity name.

This commit is contained in:
Håvard Pettersson 2014-09-13 00:40:59 +02:00
parent 2bcef77aa5
commit 5a3b0cc583

View File

@ -58,13 +58,15 @@ bar_item_buffer_plugin(void *data, struct t_gui_bar_item *item,
char string[256]; char string[256];
const char *name = weechat_plugin_get_name(weechat_plugin); const char *plugin_name = weechat_plugin_get_name(weechat_plugin);
const char *identity_name = identity->name;
const char *status = identity->is_connected ? "online" : "offline";
const char *color = weechat_color(identity->is_connected ? "green" : "red");
snprintf(string, sizeof(string), snprintf(string, sizeof(string),
"%s %s%s", name, color, status); "%s%s/%s%s",
plugin_name,
weechat_color("bar_delim"),
weechat_color("bar_fg"),
identity_name);
return strdup(string); return strdup(string);
} }