1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-16 01:57:09 +00:00

Make default_graph_{width,height} lua settings

This commit is contained in:
Pavel Labath 2010-08-26 17:17:21 +02:00
parent 34a34693d7
commit 184afe1555
6 changed files with 23 additions and 26 deletions

View File

@ -138,13 +138,21 @@
<varlistentry> <varlistentry>
<term> <term>
<command> <command>
<option>default_graph_size</option> <option>default_graph_height</option>
</command> </command>
</term> </term>
<listitem>Specify a default width and height for graphs. <listitem>Specify a default height for graphs. This is particularly useful for execgraph
Example: 'default_graph_size 0 25'. This is particularly and execigraph as they do not take size arguments
useful for execgraph and execigraph as they do not take <para /></listitem>
size arguments </varlistentry>
<varlistentry>
<term>
<command>
<option>default_graph_width</option>
</command>
</term>
<listitem>Specify a default width for graphs. This is particularly useful for execgraph
and execigraph as they do not take size arguments
<para /></listitem> <para /></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>

View File

@ -5,7 +5,7 @@
syntax "conky" "(\.*conkyrc.*$|conky.conf)" syntax "conky" "(\.*conkyrc.*$|conky.conf)"
## Configuration items ## Configuration items
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_height|default_bar_width|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|http_refresh|if_up_strictness|imap|imlib_cache_flush_interval|imlib_cache_size|lua_draw_hook_post|lua_draw_hook_pre|lua_load|lua_shutdown_hook|lua_startup_hook|mail_spool|max_port_monitor_connections|max_text_width|max_user_text|maximum_width|minimum_size|mpd_host|mpd_password|mpd_port|music_player_interval|mysql_host|mysql_port|mysql_user|mysql_password|mysql_db|net_avg_samples|no_buffers|nvidia_display|out_to_console|out_to_http|out_to_ncurses|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|times_in_seconds|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_height|default_bar_width|default_color|default_gauge_size|default_graph_height|default_graph_width|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|http_refresh|if_up_strictness|imap|imlib_cache_flush_interval|imlib_cache_size|lua_draw_hook_post|lua_draw_hook_pre|lua_load|lua_shutdown_hook|lua_startup_hook|mail_spool|max_port_monitor_connections|max_text_width|max_user_text|maximum_width|minimum_size|mpd_host|mpd_password|mpd_port|music_player_interval|mysql_host|mysql_port|mysql_user|mysql_password|mysql_db|net_avg_samples|no_buffers|nvidia_display|out_to_console|out_to_http|out_to_ncurses|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|times_in_seconds|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 ## 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|middle_middle|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|middle_middle|undecorated|yes)\>"

View File

@ -12,7 +12,7 @@ endif
syn region ConkyrcComment start=/^\s*#/ end=/$/ syn region ConkyrcComment start=/^\s*#/ end=/$/
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_height default_bar_width 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 http_refresh if_up_strictness imap imlib_cache_flush_interval imlib_cache_size lua_draw_hook_post lua_draw_hook_pre lua_load lua_shutdown_hook lua_startup_hook mail_spool max_port_monitor_connections max_text_width max_user_text maximum_width minimum_size mpd_host mpd_password mpd_port music_player_interval mysql_host mysql_port mysql_user mysql_password mysql_db net_avg_samples no_buffers nvidia_display out_to_console out_to_http out_to_ncurses 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 times_in_seconds 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_height default_bar_width default_color default_gauge_size default_graph_height default_graph_width 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 http_refresh if_up_strictness imap imlib_cache_flush_interval imlib_cache_size lua_draw_hook_post lua_draw_hook_pre lua_load lua_shutdown_hook lua_startup_hook mail_spool max_port_monitor_connections max_text_width max_user_text maximum_width minimum_size mpd_host mpd_password mpd_port music_player_interval mysql_host mysql_port mysql_user mysql_password mysql_db net_avg_samples no_buffers nvidia_display out_to_console out_to_http out_to_ncurses 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 times_in_seconds 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 syn keyword ConkyrcConstant
\ above \ above

View File

@ -2798,19 +2798,6 @@ char load_config_file(const char *f)
} }
} }
#ifdef BUILD_X11 #ifdef BUILD_X11
CONF("default_graph_size") {
char err = 0;
if (value) {
if (sscanf(value, "%d %d", &default_graph_width, &default_graph_height) != 2) {
err = 1;
}
} else {
err = 1;
}
if (err) {
CONF_ERR2("default_graph_size takes 2 integer arguments (ie. 'default_graph_size 0 6')")
}
}
CONF("default_gauge_size") { CONF("default_gauge_size") {
char err = 0; char err = 0;
if (value) { if (value) {

View File

@ -50,10 +50,14 @@ namespace {
std::numeric_limits<int>::max(), 0, false); std::numeric_limits<int>::max(), 0, false);
conky::range_config_setting<int> default_bar_height("default_bar_height", 0, conky::range_config_setting<int> default_bar_height("default_bar_height", 0,
std::numeric_limits<int>::max(), 6, false); std::numeric_limits<int>::max(), 6, false);
}
#ifdef BUILD_X11 #ifdef BUILD_X11
int default_graph_width = 0, default_graph_height = 25; conky::range_config_setting<int> default_graph_width("default_graph_width", 0,
std::numeric_limits<int>::max(), 0, false);
conky::range_config_setting<int> default_graph_height("default_graph_height", 0,
std::numeric_limits<int>::max(), 25, false);
#endif /* BUILD_X11 */ #endif /* BUILD_X11 */
}
int default_gauge_width = 40, default_gauge_height = 25; int default_gauge_width = 40, default_gauge_height = 25;
/* special data types flags */ /* special data types flags */
@ -176,8 +180,8 @@ char *scan_graph(struct text_object *obj, const char *args, double defscale)
obj->special_data = g; obj->special_data = g;
/* zero width means all space that is available */ /* zero width means all space that is available */
g->width = default_graph_width; g->width = default_graph_width.get(*state);
g->height = default_graph_height; g->height = default_graph_height.get(*state);
g->first_colour = 0; g->first_colour = 0;
g->last_colour = 0; g->last_colour = 0;
g->scale = defscale; g->scale = defscale;

View File

@ -81,8 +81,6 @@ extern struct special_t *specials;
extern int special_count; extern int special_count;
#ifdef BUILD_X11 #ifdef BUILD_X11
extern int default_graph_width;
extern int default_graph_height;
extern int default_gauge_width; extern int default_gauge_width;
extern int default_gauge_height; extern int default_gauge_height;
#endif /* BUILD_X11 */ #endif /* BUILD_X11 */