From f169e0e0719688cc1b80f474b9ccd7eae6006838 Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Mon, 20 Jul 2009 12:40:32 -0600 Subject: [PATCH] Actually apply c1cf1232e002bd32e1bc07ea0e7ffdcf4454e09f. --- data/conky.conf | 1 + doc/config_settings.xml | 10 ++++++++++ extras/nano/conky.nanorc | 2 +- extras/vim/syntax/conkyrc.vim | 2 +- src/conky.c | 5 +++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/data/conky.conf b/data/conky.conf index a96b873..b64e128 100644 --- a/data/conky.conf +++ b/data/conky.conf @@ -43,6 +43,7 @@ net_avg_samples 2 no_buffers yes out_to_console no out_to_stderr no +extra_newline no own_window yes own_window_class Conky own_window_type desktop diff --git a/doc/config_settings.xml b/doc/config_settings.xml index 85f0b1b..7cbcfc7 100644 --- a/doc/config_settings.xml +++ b/doc/config_settings.xml @@ -242,6 +242,16 @@ + + + + Put an extra newline at the end when writing to + stdout, useful for writing to awesome's wiboxes. + + + + + diff --git a/extras/nano/conky.nanorc b/extras/nano/conky.nanorc index 0b76abb..b12d266 100644 --- a/extras/nano/conky.nanorc +++ b/extras/nano/conky.nanorc @@ -5,7 +5,7 @@ syntax "conky" "(\.*conkyrc.*$|conky.conf)" ## Configuration items -color green "\<(alias|alignment|append_file|background|border_inner_margin|border_margin|border_outer_margin|border_width|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|colorN|cpu_avg_samples|default_bar_size|default_color|default_gauge_size|default_graph_size|default_outline_color|default_shade_color|diskio_avg_samples|display|double_buffer|draw_borders|draw_graph_borders|draw_outline|draw_shades|font|format_human_readable|gap_x|gap_y|if_up_strictness|imap|imlib_cache_flush_interval|imlib_cache_size|lua_draw_hook_post|lua_draw_hook_pre|lua_load|mail_spool|max_port_monitor_connections|max_specials|max_user_text|maximum_width|minimum_size|mpd_host|mpd_password|mpd_port|music_player_interval|net_avg_samples|no_buffers|out_to_console|out_to_stderr|out_to_x|override_utf8_locale|overwrite_file|own_window|own_window_class|own_window_colour|own_window_hints|own_window_title|own_window_transparent|own_window_type|pad_percents|pop3|sensor_device|short_units|show_graph_range|show_graph_scale|stippled_borders|temperature_unit|template|template0|template1|template2|template3|template4|template5|template6|template7|template8|template9|text|text_buffer_size|top_cpu_separate|top_name_width|total_run_times|update_interval|uppercase|use_spacer|use_xft|xftalpha|xftfont)\>" +color green "\<(alias|alignment|append_file|background|border_inner_margin|border_margin|border_outer_margin|border_width|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|colorN|cpu_avg_samples|default_bar_size|default_color|default_gauge_size|default_graph_size|default_outline_color|default_shade_color|diskio_avg_samples|display|double_buffer|draw_borders|draw_graph_borders|draw_outline|draw_shades|extra_newline|font|format_human_readable|gap_x|gap_y|if_up_strictness|imap|imlib_cache_flush_interval|imlib_cache_size|lua_draw_hook_post|lua_draw_hook_pre|lua_load|mail_spool|max_port_monitor_connections|max_specials|max_user_text|maximum_width|minimum_size|mpd_host|mpd_password|mpd_port|music_player_interval|net_avg_samples|no_buffers|out_to_console|out_to_stderr|out_to_x|override_utf8_locale|overwrite_file|own_window|own_window_class|own_window_colour|own_window_hints|own_window_title|own_window_transparent|own_window_type|pad_percents|pop3|sensor_device|short_units|show_graph_range|show_graph_scale|stippled_borders|temperature_unit|template|template0|template1|template2|template3|template4|template5|template6|template7|template8|template9|text|text_buffer_size|top_cpu_separate|top_name_width|total_run_times|update_interval|uppercase|use_spacer|use_xft|xftalpha|xftfont)\>" ## Configuration item constants color yellow "\<(above|below|bottom_left|bottom_right|bottom_middle|desktop|dock|no|none|normal|override|skip_pager|skip_taskbar|sticky|top_left|top_right|top_middle|middle_left|middle_right|undecorated|yes)\>" diff --git a/extras/vim/syntax/conkyrc.vim b/extras/vim/syntax/conkyrc.vim index b41a7b1..f1180b0 100644 --- a/extras/vim/syntax/conkyrc.vim +++ b/extras/vim/syntax/conkyrc.vim @@ -12,7 +12,7 @@ endif syn region ConkyrcComment start=/^\s*#/ end=/$/ -syn keyword ConkyrcSetting alias alignment append_file background border_inner_margin border_margin border_outer_margin border_width color0 color1 color2 color3 color4 color5 color6 color7 color8 color9 colorN cpu_avg_samples default_bar_size default_color default_gauge_size default_graph_size default_outline_color default_shade_color diskio_avg_samples display double_buffer draw_borders draw_graph_borders draw_outline draw_shades font format_human_readable gap_x gap_y if_up_strictness imap imlib_cache_flush_interval imlib_cache_size lua_draw_hook_post lua_draw_hook_pre lua_load mail_spool max_port_monitor_connections max_specials max_user_text maximum_width minimum_size mpd_host mpd_password mpd_port music_player_interval net_avg_samples no_buffers out_to_console out_to_stderr out_to_x override_utf8_locale overwrite_file own_window own_window_class own_window_colour own_window_hints own_window_title own_window_transparent own_window_type pad_percents pop3 sensor_device short_units show_graph_range show_graph_scale stippled_borders temperature_unit template template0 template1 template2 template3 template4 template5 template6 template7 template8 template9 text text_buffer_size top_cpu_separate top_name_width total_run_times update_interval uppercase use_spacer use_xft xftalpha xftfont +syn keyword ConkyrcSetting alias alignment append_file background border_inner_margin border_margin border_outer_margin border_width color0 color1 color2 color3 color4 color5 color6 color7 color8 color9 colorN cpu_avg_samples default_bar_size default_color default_gauge_size default_graph_size default_outline_color default_shade_color diskio_avg_samples display double_buffer draw_borders draw_graph_borders draw_outline draw_shades extra_newline font format_human_readable gap_x gap_y if_up_strictness imap imlib_cache_flush_interval imlib_cache_size lua_draw_hook_post lua_draw_hook_pre lua_load mail_spool max_port_monitor_connections max_specials max_user_text maximum_width minimum_size mpd_host mpd_password mpd_port music_player_interval net_avg_samples no_buffers out_to_console out_to_stderr out_to_x override_utf8_locale overwrite_file own_window own_window_class own_window_colour own_window_hints own_window_title own_window_transparent own_window_type pad_percents pop3 sensor_device short_units show_graph_range show_graph_scale stippled_borders temperature_unit template template0 template1 template2 template3 template4 template5 template6 template7 template8 template9 text text_buffer_size top_cpu_separate top_name_width total_run_times update_interval uppercase use_spacer use_xft xftalpha xftfont syn keyword ConkyrcConstant \ above diff --git a/src/conky.c b/src/conky.c index 136773c..3e82ac5 100644 --- a/src/conky.c +++ b/src/conky.c @@ -142,6 +142,7 @@ int top_io; #endif static unsigned int top_name_width = 15; int output_methods; +static int extra_newline; enum x_initialiser_state x_initialised = NO; static volatile int g_signal_pending; /* Update interval */ @@ -6385,6 +6386,7 @@ static void draw_string(const char *s) width_of_s = get_string_width(s); if ((output_methods & TO_STDOUT) && draw_mode == FG) { printf("%s\n", s); + if (extra_newline) fputc('\n', stdout); fflush(stdout); /* output immediately, don't buffer */ } if ((output_methods & TO_STDERR) && draw_mode == FG) { @@ -8330,6 +8332,9 @@ static void load_config_file(const char *f) if(string_to_bool(value)) output_methods |= TO_STDOUT; } + CONF("extra_newline") { + extra_newline = string_to_bool(value); + } CONF("out_to_stderr") { if(string_to_bool(value)) output_methods |= TO_STDERR; -- 1.7.9.5