Add some trivial additional status line attributes from jwcxz at users

dot sourceforge dot net.
This commit is contained in:
Nicholas Marriott 2012-01-20 19:51:28 +00:00
parent 199d148740
commit 8cf19ab770
3 changed files with 81 additions and 14 deletions

View File

@ -570,17 +570,47 @@ const struct options_table_entry window_options_table[] = {
.default_num = 0 /* overridden in main() */ .default_num = 0 /* overridden in main() */
}, },
{ .name = "window-status-alert-attr", { .name = "window-status-bell-attr",
.type = OPTIONS_TABLE_ATTRIBUTES, .type = OPTIONS_TABLE_ATTRIBUTES,
.default_num = GRID_ATTR_REVERSE .default_num = GRID_ATTR_REVERSE
}, },
{ .name = "window-status-alert-bg", { .name = "window-status-bell-bg",
.type = OPTIONS_TABLE_COLOUR, .type = OPTIONS_TABLE_COLOUR,
.default_num = 8 .default_num = 8
}, },
{ .name = "window-status-alert-fg", { .name = "window-status-bell-fg",
.type = OPTIONS_TABLE_COLOUR,
.default_num = 8
},
{ .name = "window-status-content-attr",
.type = OPTIONS_TABLE_ATTRIBUTES,
.default_num = GRID_ATTR_REVERSE
},
{ .name = "window-status-content-bg",
.type = OPTIONS_TABLE_COLOUR,
.default_num = 8
},
{ .name = "window-status-content-fg",
.type = OPTIONS_TABLE_COLOUR,
.default_num = 8
},
{ .name = "window-status-activity-attr",
.type = OPTIONS_TABLE_ATTRIBUTES,
.default_num = GRID_ATTR_REVERSE
},
{ .name = "window-status-activity-bg",
.type = OPTIONS_TABLE_COLOUR,
.default_num = 8
},
{ .name = "window-status-activity-fg",
.type = OPTIONS_TABLE_COLOUR, .type = OPTIONS_TABLE_COLOUR,
.default_num = 8 .default_num = 8
}, },

View File

@ -684,14 +684,34 @@ status_print(
fmt = options_get_string(oo, "window-status-current-format"); fmt = options_get_string(oo, "window-status-current-format");
} }
if (wl->flags & WINLINK_ALERTFLAGS) { if (wl->flags & WINLINK_BELL) {
fg = options_get_number(oo, "window-status-alert-fg"); fg = options_get_number(oo, "window-status-bell-fg");
if (fg != 8) if (fg != 8)
colour_set_fg(gc, fg); colour_set_fg(gc, fg);
bg = options_get_number(oo, "window-status-alert-bg"); bg = options_get_number(oo, "window-status-bell-bg");
if (bg != 8) if (bg != 8)
colour_set_bg(gc, bg); colour_set_bg(gc, bg);
attr = options_get_number(oo, "window-status-alert-attr"); attr = options_get_number(oo, "window-status-bell-attr");
if (attr != 0)
gc->attr = attr;
} else if (wl->flags & WINLINK_CONTENT) {
fg = options_get_number(oo, "window-status-content-fg");
if (fg != 8)
colour_set_fg(gc, fg);
bg = options_get_number(oo, "window-status-content-bg");
if (bg != 8)
colour_set_bg(gc, bg);
attr = options_get_number(oo, "window-status-content-attr");
if (attr != 0)
gc->attr = attr;
} else if (wl->flags & (WINLINK_ACTIVITY|WINLINK_SILENCE)) {
fg = options_get_number(oo, "window-status-activity-fg");
if (fg != 8)
colour_set_fg(gc, fg);
bg = options_get_number(oo, "window-status-activity-bg");
if (bg != 8)
colour_set_bg(gc, bg);
attr = options_get_number(oo, "window-status-activity-attr");
if (attr != 0) if (attr != 0)
gc->attr = attr; gc->attr = attr;
} }

31
tmux.1
View File

@ -2516,15 +2516,32 @@ Instructs
.Nm .Nm
to expect UTF-8 sequences to appear in this window. to expect UTF-8 sequences to appear in this window.
.Pp .Pp
.It Ic window-status-alert-attr Ar attributes .It Ic window-status-bell-attr Ar attributes
Set status line attributes for windows which have an alert (bell, activity Set status line attributes for windows which have a bell alert.
or content).
.Pp .Pp
.It Ic window-status-alert-bg Ar colour .It Ic window-status-bell-bg Ar colour
Set status line background colour for windows with an alert. Set status line background colour for windows with a bell alert.
.Pp .Pp
.It Ic window-status-alert-fg Ar colour .It Ic window-status-bell-fg Ar colour
Set status line foreground colour for windows with an alert. Set status line foreground colour for windows with a bell alert.
.Pp
.It Ic window-status-content-attr Ar attributes
Set status line attributes for windows which have a content alert.
.Pp
.It Ic window-status-content-bg Ar colour
Set status line background colour for windows with a content alert.
.Pp
.It Ic window-status-content-fg Ar colour
Set status line foreground colour for windows with a content alert.
.Pp
.It Ic window-status-activity-attr Ar attributes
Set status line attributes for windows which have an activity (or silence) alert.
.Pp
.It Ic window-status-activity-bg Ar colour
Set status line background colour for windows with an activity alert.
.Pp
.It Ic window-status-activity-fg Ar colour
Set status line foreground colour for windows with an activity alert.
.Pp .Pp
.It Ic window-status-attr Ar attributes .It Ic window-status-attr Ar attributes
Set status line attributes for a single window. Set status line attributes for a single window.