new option: igonre_newline

see github issue 83
This commit is contained in:
Sascha Kruse 2013-01-02 12:21:53 +01:00
parent 414d3d056a
commit a51f564037
3 changed files with 13 additions and 1 deletions

View File

@ -22,6 +22,7 @@ float bounce_freq = 1; /* determines the bounce frequency (if activated
int sticky_history = True; int sticky_history = True;
int verbosity = 0; int verbosity = 0;
int word_wrap = False; int word_wrap = False;
int ignore_newline = False;
int line_height = 0; /* if line height < font height, it will be raised to font height */ int line_height = 0; /* if line height < font height, it will be raised to font height */
int separator_height = 2; /* height of the separator line between two notifications */ int separator_height = 2; /* height of the separator line between two notifications */

View File

@ -1078,6 +1078,10 @@ int init_notification(notification * n, int id)
while (strstr(n->msg, "\\n") != NULL) while (strstr(n->msg, "\\n") != NULL)
n->msg = string_replace("\\n", "\n", n->msg); n->msg = string_replace("\\n", "\n", n->msg);
if (ignore_newline)
while (strstr(n->msg, "\n") != NULL)
n->msg = string_replace("\n", " ", n->msg);
n->msg = rstrip(n->msg); n->msg = rstrip(n->msg);
@ -1613,6 +1617,10 @@ void load_options(char *cmdline_config_path)
word_wrap = word_wrap =
option_get_bool("global", "word_wrap", "-word_wrap", word_wrap, option_get_bool("global", "word_wrap", "-word_wrap", word_wrap,
"Truncating long lines or do word wrap"); "Truncating long lines or do word wrap");
ignore_newline =
option_get_bool("global", "ignore_newline", "-ignore_newline",
ignore_newline, "Ignore newline characters in notifications");
idle_threshold = idle_threshold =
option_get_int("global", "idle_threshold", "-idle_threshold", option_get_int("global", "idle_threshold", "-idle_threshold",
idle_threshold, idle_threshold,

View File

@ -30,9 +30,12 @@
# set to -1 to disable # set to -1 to disable
show_age_threshold = 60; show_age_threshold = 60;
# split long notifications into multiple lines # split notifications into multiple lines if they don't fit into geometry
word_wrap = yes word_wrap = yes
# ignore newlines '\n' in notifications
ignore_newline = no
# the geometry of the window # the geometry of the window
# geometry [{width}]x{height}][+/-{x}+/-{y}] # geometry [{width}]x{height}][+/-{x}+/-{y}]