summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2012-01-20 21:20:35 +0000
committerTiago Cunha <tcunha@gmx.com>2012-01-20 21:20:35 +0000
commitb7551c9193c6fe48c68a5555b9b51a9cc3f69511 (patch)
tree38d66aace19408b94db8042170ed3359ca4e3944
parentd4312281da242d980e7f84555dc713f58c64b9a7 (diff)
Sync OpenBSD patchset 1001:
Add some trivial additional status line attributes from jwcxz at users dot sourceforge dot net.
-rw-r--r--options-table.c36
-rw-r--r--status.c28
-rw-r--r--tmux.131
3 files changed, 81 insertions, 14 deletions
diff --git a/options-table.c b/options-table.c
index 83187801..778d5ed5 100644
--- a/options-table.c
+++ b/options-table.c
@@ -569,17 +569,47 @@ const struct options_table_entry window_options_table[] = {
.default_num = 0 /* overridden in main() */
},
- { .name = "window-status-alert-attr",
+ { .name = "window-status-bell-attr",
.type = OPTIONS_TABLE_ATTRIBUTES,
.default_num = GRID_ATTR_REVERSE
},
- { .name = "window-status-alert-bg",
+ { .name = "window-status-bell-bg",
.type = OPTIONS_TABLE_COLOUR,
.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,
.default_num = 8
},
diff --git a/status.c b/status.c
index 154bd6ce..8e065ce8 100644
--- a/status.c
+++ b/status.c
@@ -684,14 +684,34 @@ status_print(
fmt = options_get_string(oo, "window-status-current-format");
}
- if (wl->flags & WINLINK_ALERTFLAGS) {
- fg = options_get_number(oo, "window-status-alert-fg");
+ if (wl->flags & WINLINK_BELL) {
+ fg = options_get_number(oo, "window-status-bell-fg");
if (fg != 8)
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)
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)
gc->attr = attr;
}
diff --git a/tmux.1 b/tmux.1
index 862ed2d5..a57407f6 100644
--- a/tmux.1
+++ b/tmux.1
@@ -2520,15 +2520,32 @@ Instructs
.Nm
to expect UTF-8 sequences to appear in this window.
.Pp
-.It Ic window-status-alert-attr Ar attributes
-Set status line attributes for windows which have an alert (bell, activity
-or content).
+.It Ic window-status-bell-attr Ar attributes
+Set status line attributes for windows which have a bell alert.
.Pp
-.It Ic window-status-alert-bg Ar colour
-Set status line background colour for windows with an alert.
+.It Ic window-status-bell-bg Ar colour
+Set status line background colour for windows with a bell alert.
.Pp
-.It Ic window-status-alert-fg Ar colour
-Set status line foreground colour for windows with an alert.
+.It Ic window-status-bell-fg Ar colour
+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
.It Ic window-status-attr Ar attributes
Set status line attributes for a single window.