Added output_to_stderr
authorNikolas Garofil <ngarofil@users.sourceforge.net>
Tue, 10 Feb 2009 08:43:20 +0000 (09:43 +0100)
committerNikolas Garofil <garo@dunaldi.garofil.be>
Tue, 10 Feb 2009 08:43:20 +0000 (09:43 +0100)
ChangeLog
data/conky.conf
doc/config_settings.xml
doc/conky.1
doc/conky.conf
extras/nano/conky.nanorc
extras/vim/syntax/conkyrc.vim
src/conky.c

index 5aa2bb3..11e0819 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2009-02-10
+       * Added output_to_stderr
+
 2009-02-08
        * Refactor top code, add top_time to sort by process cpu time (thanks
        sohalt).
index d61f9ef..ddfe608 100644 (file)
@@ -41,6 +41,7 @@ minimum_size 5 5
 net_avg_samples 2
 no_buffers yes
 out_to_console no
+out_to_stderr no
 own_window yes
 own_window_class Conky
 own_window_type normal
index 5ab6591..7e59df2 100644 (file)
        </varlistentry>
 
        <varlistentry>
+               <term><command><option>out_to_stderr</option></command>
+               </term>
+               <listitem>
+                       Print text to stderr.
+                       <para></para></listitem>
+       </varlistentry>
+
+       <varlistentry>
                <term><command><option>pad_percents</option></command></term>
                <listitem>
                        Pad percentages to this many decimals (0 = no padding)
index f7a5f3d..c3f24b9 100644 (file)
@@ -323,6 +323,10 @@ of window can be useful for certain situations.
 Print text to stdout.
 
 .TP 
+\fB\*(T<\fBout_to_stderr\fR\*(T>\fR 
+Print text to stderr.
+
+.TP 
 \fB\*(T<\fBpad_percents\fR\*(T>\fR
 Pad percentages to this many decimals (0 = no padding)
 
index 2e03542..b5843d2 100644 (file)
@@ -28,6 +28,9 @@ xftalpha 0.8
 # Print everything to stdout?
 # out_to_console no
 
+# ... or maybe to stderr ?
+# out_to_stderr no
+
 # MPD host/port
 # mpd_host localhost
 # mpd_port 6600
index ddee394..e6362fa 100644 (file)
@@ -5,7 +5,7 @@
 syntax "conky" "(\.*conkyrc.*$|conky.conf)"
 
 ## Configuration items
-color green "\<(alignment|background|show_graph_range|show_graph_scale|border_margin|border_width|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|default_color|default_shade_color|default_shadecolor|default_outline_color|default_outlinecolor|imap|pop3|mpd_host|mpd_port|mpd_password|music_player_interval|sensor_device|cpu_avg_samples|net_avg_samples|double_buffer|override_utf8_locale|draw_borders|draw_graph_borders|draw_shades|draw_outline|out_to_console|use_spacer|use_xft|font|xftalpha|xftfont|use_xft|gap_x|gap_y|mail_spool|minimum_size|maximum_width|no_buffers|template0|template1|template2|template3|template4|template5|template6|template7|template8|template9|top_cpu_separate|short_units|pad_percents|own_window|own_window_class|own_window_title|own_window_transparent|own_window_colour|own_window_hints|own_window_type|stippled_borders|temp1|temp2|update_interval|total_run_times|uppercase|max_specials|max_user_text|text_buffer_size|max_port_monitor_connections)\>"
+color green "\<(alignment|background|show_graph_range|show_graph_scale|border_margin|border_width|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|default_color|default_shade_color|default_shadecolor|default_outline_color|default_outlinecolor|imap|pop3|mpd_host|mpd_port|mpd_password|music_player_interval|sensor_device|cpu_avg_samples|net_avg_samples|double_buffer|override_utf8_locale|draw_borders|draw_graph_borders|draw_shades|draw_outline|out_to_console|out_to_stderr|use_spacer|use_xft|font|xftalpha|xftfont|use_xft|gap_x|gap_y|mail_spool|minimum_size|maximum_width|no_buffers|template0|template1|template2|template3|template4|template5|template6|template7|template8|template9|top_cpu_separate|short_units|pad_percents|own_window|own_window_class|own_window_title|own_window_transparent|own_window_colour|own_window_hints|own_window_type|stippled_borders|temp1|temp2|update_interval|total_run_times|uppercase|max_specials|max_user_text|text_buffer_size|max_port_monitor_connections)\>"
 
 ## 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)\>"
index b3a93e5..311770f 100644 (file)
@@ -50,6 +50,7 @@ syn keyword ConkyrcSetting
                        \ draw_shades
                        \ draw_outline
                        \ out_to_console
+                       \ out_to_stderr
                        \ use_spacer
                        \ use_xft
                        \ font
index 120c32e..0027b3f 100644 (file)
@@ -128,6 +128,7 @@ enum {
 int top_cpu, top_mem, top_time;
 #define TO_X 1
 #define TO_STDOUT 2
+#define TO_STDERR 4
 static int output_methods;
 static volatile int g_signal_pending;
 /* Update interval */
@@ -5840,6 +5841,10 @@ static void draw_string(const char *s)
                printf("%s\n", s);
                fflush(stdout); /* output immediately, don't buffer */
        }
+       if ((output_methods & TO_STDERR) && draw_mode == FG) {
+               fprintf(stderr, "%s\n", s);
+               fflush(stderr); /* output immediately, don't buffer */
+       }
        memset(tmpstring1, 0, text_buffer_size);
        memset(tmpstring2, 0, text_buffer_size);
        strncpy(tmpstring1, s, text_buffer_size - 1);
@@ -7476,6 +7481,9 @@ static void load_config_file(const char *f)
                CONF("out_to_console") {
                        if(string_to_bool(value)) output_methods |= TO_STDOUT;
                }
+               CONF("out_to_stderr") {
+                       if(string_to_bool(value)) output_methods |= TO_STDERR;
+               }
                CONF("use_spacer") {
                        if (value) {
                                if (strcasecmp(value, "left") == EQUAL) {