1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-05 21:07:52 +00:00

Added output_to_stderr

This commit is contained in:
Nikolas Garofil 2009-02-10 09:43:20 +01:00 committed by Nikolas Garofil
parent c3003dc1a3
commit 4c25a9680e
8 changed files with 29 additions and 1 deletions

View File

@ -1,3 +1,6 @@
2009-02-10
* Added output_to_stderr
2009-02-08 2009-02-08
* Refactor top code, add top_time to sort by process cpu time (thanks * Refactor top code, add top_time to sort by process cpu time (thanks
sohalt). sohalt).

View File

@ -41,6 +41,7 @@ minimum_size 5 5
net_avg_samples 2 net_avg_samples 2
no_buffers yes no_buffers yes
out_to_console no out_to_console no
out_to_stderr no
own_window yes own_window yes
own_window_class Conky own_window_class Conky
own_window_type normal own_window_type normal

View File

@ -315,6 +315,14 @@
<para></para></listitem> <para></para></listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><command><option>out_to_stderr</option></command>
</term>
<listitem>
Print text to stderr.
<para></para></listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><command><option>pad_percents</option></command></term> <term><command><option>pad_percents</option></command></term>
<listitem> <listitem>

View File

@ -322,6 +322,10 @@ of window can be useful for certain situations.
\fB\*(T<\fBout_to_console\fR\*(T>\fR \fB\*(T<\fBout_to_console\fR\*(T>\fR
Print text to stdout. Print text to stdout.
.TP
\fB\*(T<\fBout_to_stderr\fR\*(T>\fR
Print text to stderr.
.TP .TP
\fB\*(T<\fBpad_percents\fR\*(T>\fR \fB\*(T<\fBpad_percents\fR\*(T>\fR
Pad percentages to this many decimals (0 = no padding) Pad percentages to this many decimals (0 = no padding)

View File

@ -28,6 +28,9 @@ xftalpha 0.8
# Print everything to stdout? # Print everything to stdout?
# out_to_console no # out_to_console no
# ... or maybe to stderr ?
# out_to_stderr no
# MPD host/port # MPD host/port
# mpd_host localhost # mpd_host localhost
# mpd_port 6600 # mpd_port 6600

View File

@ -5,7 +5,7 @@
syntax "conky" "(\.*conkyrc.*$|conky.conf)" syntax "conky" "(\.*conkyrc.*$|conky.conf)"
## Configuration items ## 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 ## 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)\>" 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)\>"

View File

@ -50,6 +50,7 @@ syn keyword ConkyrcSetting
\ draw_shades \ draw_shades
\ draw_outline \ draw_outline
\ out_to_console \ out_to_console
\ out_to_stderr
\ use_spacer \ use_spacer
\ use_xft \ use_xft
\ font \ font

View File

@ -128,6 +128,7 @@ enum {
int top_cpu, top_mem, top_time; int top_cpu, top_mem, top_time;
#define TO_X 1 #define TO_X 1
#define TO_STDOUT 2 #define TO_STDOUT 2
#define TO_STDERR 4
static int output_methods; static int output_methods;
static volatile int g_signal_pending; static volatile int g_signal_pending;
/* Update interval */ /* Update interval */
@ -5840,6 +5841,10 @@ static void draw_string(const char *s)
printf("%s\n", s); printf("%s\n", s);
fflush(stdout); /* output immediately, don't buffer */ 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(tmpstring1, 0, text_buffer_size);
memset(tmpstring2, 0, text_buffer_size); memset(tmpstring2, 0, text_buffer_size);
strncpy(tmpstring1, s, text_buffer_size - 1); strncpy(tmpstring1, s, text_buffer_size - 1);
@ -7476,6 +7481,9 @@ static void load_config_file(const char *f)
CONF("out_to_console") { CONF("out_to_console") {
if(string_to_bool(value)) output_methods |= TO_STDOUT; 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") { CONF("use_spacer") {
if (value) { if (value) {
if (strcasecmp(value, "left") == EQUAL) { if (strcasecmp(value, "left") == EQUAL) {