From be145bd55dbb207eeb13a223117f8f1fd9a91d29 Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Fri, 31 Jul 2009 00:33:06 -0600 Subject: [PATCH] Removed alias config option due to brokenness. The alias option was broken by fb8ccd7a05847c19a863be785d1786846671a1c9, and it seems like trying to make it work again will only result in breakage for env var substitution anyway. --- ChangeLog | 3 +++ doc/config_settings.xml | 16 ---------------- doc/docs.xml | 2 +- doc/variables.xml | 7 ++++--- extras/nano/conky.nanorc | 2 +- extras/vim/syntax/conkyrc.vim | 2 +- src/conky.c | 26 ++------------------------ src/conky.h | 2 +- 8 files changed, 13 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index b05d844..00d2c59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2009-07-31 + * Removed alias config option due to brokenness + 2009-07-29 * Add icon data_type for xoap weather diff --git a/doc/config_settings.xml b/doc/config_settings.xml index 2d9ad35..bae2d83 100644 --- a/doc/config_settings.xml +++ b/doc/config_settings.xml @@ -14,22 +14,6 @@ - - - - Use this to create aliases of variables. The - first argument is the new name, the second the old name, - and the other arguments are passed on to the variable. - Example: If you want to use $alpha instead of ${beta gamma - delta} then you have to write the following: alias alpha - beta gamma delta . PS: Instead of creating an alias in the - config you can also use environment variables. Example: - Start conky like this: alpha="beta gamma delta" conky - - - - - diff --git a/doc/docs.xml b/doc/docs.xml index e826a9f..31cbf0a 100644 --- a/doc/docs.xml +++ b/doc/docs.xml @@ -16,7 +16,7 @@ Brenden Matthews - 2009-07-28 + 2009-07-31 conky diff --git a/doc/variables.xml b/doc/variables.xml index cd35e97..6efb08e 100644 --- a/doc/variables.xml +++ b/doc/variables.xml @@ -3393,9 +3393,10 @@ icon - + 'delay_in_minutes' (optional, default 30) cannot diff --git a/extras/nano/conky.nanorc b/extras/nano/conky.nanorc index 84a9efa..cf883e3 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_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|update_interval_on_battery|uppercase|use_spacer|use_xft|xftalpha|xftfont)\>" +color green "\<(alignment|append_file|background|border_inner_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|update_interval_on_battery|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 a4f9fae..9b28d40 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_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 update_interval_on_battery uppercase use_spacer use_xft xftalpha xftfont +syn keyword ConkyrcSetting alignment append_file background border_inner_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 update_interval_on_battery uppercase use_spacer use_xft xftalpha xftfont syn keyword ConkyrcConstant \ above diff --git a/src/conky.c b/src/conky.c index 4ed4e36..d9df955 100644 --- a/src/conky.c +++ b/src/conky.c @@ -3605,11 +3605,10 @@ static void extract_variable_text(const char *p) extract_variable_text_internal(&global_root_object, p); } -void parse_conky_vars(struct text_object *root, char *txt, char *p, struct information *cur) +void parse_conky_vars(struct text_object *root, const char *txt, char *p, struct information *cur) { extract_variable_text_internal(root, txt); generate_text_internal(p, max_user_text, *root, cur); - return; } static inline struct mail_s *ensure_mail_thread(struct text_object *obj, @@ -6084,7 +6083,7 @@ static void generate_text_internal(char *p, int p_max_size, #endif /* X11 */ } -void evaluate(char *text, char *buffer) +void evaluate(const char *text, char *buffer) { struct information *tmp_info; struct text_object subroot; @@ -8795,27 +8794,6 @@ static void load_config_file(const char *f) } } - CONF("alias") { - if (value) { - size_t maxlength = strlen(value); //+1 for terminating 0 not needed, 'cause of the space in the middle of value - char *skey = malloc(maxlength); - char *svalue = malloc(maxlength); - char *oldvalue; - if (sscanf(value, "%[0-9a-zA-Z_] %[^\n]", skey, svalue) == 2) { - oldvalue = getenv(skey); - if (oldvalue == NULL) { - setenv(skey, svalue, 0); - } - //PS: Don't free oldvalue, it's the real envvar, not a copy - } else { - CONF_ERR; - } - free(skey); - free(svalue); - } else { - CONF_ERR; - } - } #ifdef HAVE_LUA CONF("lua_load") { if (value) { diff --git a/src/conky.h b/src/conky.h index 5b71526..c341a53 100644 --- a/src/conky.h +++ b/src/conky.h @@ -353,7 +353,7 @@ extern int inotify_fd; /* defined in conky.c * evaluates 'text' and places the result in 'buffer' */ -void evaluate(char *text, char *buffer); +void evaluate(const char *text, char *buffer); /* maximum size of config TEXT buffer, i.e. below TEXT line. */ extern unsigned int max_user_text; -- 1.7.9.5