diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2010-05-14 19:03:09 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2010-05-14 19:03:09 +0000 |
commit | d91127958d2936fdae28d695d85c15d2bca0d9cf (patch) | |
tree | 880e5e9be66772eaa7e5c0dba52cafa5f4e551bd | |
parent | 4af4d124759b4648bded82482f4d043ad2b3bb79 (diff) | |
download | rtmux-d91127958d2936fdae28d695d85c15d2bca0d9cf.tar.gz rtmux-d91127958d2936fdae28d695d85c15d2bca0d9cf.tar.bz2 rtmux-d91127958d2936fdae28d695d85c15d2bca0d9cf.zip |
Colour+attribute options for status line alerts, from Alex Alexander.
-rw-r--r-- | cmd-set-option.c | 3 | ||||
-rw-r--r-- | status.c | 13 | ||||
-rw-r--r-- | tmux.1 | 10 | ||||
-rw-r--r-- | tmux.c | 3 |
4 files changed, 27 insertions, 2 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c index 90b6d611..85776fbb 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -157,6 +157,9 @@ const struct set_option_entry set_window_option_table[] = { { "remain-on-exit", SET_OPTION_FLAG, 0, 0, NULL }, { "synchronize-panes", SET_OPTION_FLAG, 0, 0, NULL }, { "utf8", SET_OPTION_FLAG, 0, 0, NULL }, + { "window-status-alert-attr", SET_OPTION_ATTRIBUTES, 0, 0, NULL }, + { "window-status-alert-bg", SET_OPTION_COLOUR, 0, 0, NULL }, + { "window-status-alert-fg", SET_OPTION_COLOUR, 0, 0, NULL }, { "window-status-attr", SET_OPTION_ATTRIBUTES, 0, 0, NULL }, { "window-status-bg", SET_OPTION_COLOUR, 0, 0, NULL }, { "window-status-current-attr", SET_OPTION_ATTRIBUTES, 0, 0, NULL }, @@ -595,8 +595,17 @@ status_print( if (session_alert_has(s, wl, WINDOW_ACTIVITY) || session_alert_has(s, wl, WINDOW_BELL) || - session_alert_has(s, wl, WINDOW_CONTENT)) - gc->attr ^= GRID_ATTR_REVERSE; + session_alert_has(s, wl, WINDOW_CONTENT)) { + fg = options_get_number(oo, "window-status-alert-fg"); + if (fg != 8) + colour_set_fg(gc, fg); + bg = options_get_number(oo, "window-status-alert-bg"); + if (bg != 8) + colour_set_bg(gc, bg); + attr = options_get_number(oo, "window-status-alert-attr"); + if (attr != 0) + gc->attr = attr; + } text = status_replace(c, wl, fmt, t, 1); return (text); @@ -2073,6 +2073,16 @@ option for details of special character sequences available. The default is .Ql #I:#W#F . .Pp +.It Ic window-status-alert-attr Ar attributes +Set status line attributes for windows which have an alert (bell, activity +or content). +.Pp +.It Ic window-status-alert-bg Ar colour +Set status line background colour for windows with an alert. +.Pp +.It Ic window-status-alert-fg Ar colour +Set status line foreground colour for windows with an alert. +.Pp .It Ic window-status-current-attr Ar attributes Set status line attributes for the currently active window. .Pp @@ -416,6 +416,9 @@ main(int argc, char **argv) options_set_number(wo, "window-status-current-bg", 8); options_set_number(wo, "window-status-current-fg", 8); options_set_number(wo, "window-status-fg", 8); + options_set_number(wo, "window-status-alert-attr", GRID_ATTR_REVERSE); + options_set_number(wo, "window-status-alert-bg", 8); + options_set_number(wo, "window-status-alert-fg", 8); options_set_string(wo, "window-status-format", "#I:#W#F"); options_set_string(wo, "window-status-current-format", "#I:#W#F"); options_set_string(wo, "word-separators", " -_@"); |