* Fix broken xmms2 compilation (thanks fusetak)
* Minor fix for fs_used_perc, fs_free and fs_free_perc (thanks
lightpriest)
+ * Added default_bar/graph/gauge_size config options (thanks wire64 for the
+ idea)
2009-03-28
* Applied FreeBSD patches (thanks Nikos)
combined.
+ \e[1mdefault_bar_size\e[0m
+ Specify a default width and height for bars. Example: 'de‐
+ fault_bar_size 0 6'. This is particularly useful for execbar and
+ execibar as they do not take size arguments
+
+
+ \e[1mdefault_graph_size\e[0m
+ Specify a default width and height for graphs. Example: 'de‐
+ fault_graph_size 0 25'. This is particularly useful for exec‐
+ graph and execigraph as they do not take size arguments
+
+
+ \e[1mdefault_gauge_size\e[0m
+ Specify a default width and height for gauges. Example: 'de‐
+ fault_gauge_size 25 25'. This is particularly useful for exec‐
+ gauge and execigauge as they do not take size arguments
+
+
\e[1mdefault_color\e[0m
Default color and border color
</varlistentry>
<varlistentry>
+ <term><command><option>default_bar_size</option></command></term>
+ <listitem>
+ Specify a default width and height for bars. Example: 'default_bar_size 0 6'. This is particularly useful for execbar and execibar as they do not take size arguments
+ <para></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><command><option>default_graph_size</option></command></term>
+ <listitem>
+ Specify a default width and height for graphs. Example: 'default_graph_size 0 25'. This is particularly useful for execgraph and execigraph as they do not take size arguments
+ <para></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><command><option>default_gauge_size</option></command></term>
+ <listitem>
+ Specify a default width and height for gauges. Example: 'default_gauge_size 25 25'. This is particularly useful for execgauge and execigauge as they do not take size arguments
+ <para></para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><command><option>default_color</option></command></term>
<listitem>
Default color and border color
If true, cpu in top will show usage of one processor's power. If false, cpu in top will show the usage of all processors' power combined.
.TP
+\fB\*(T<\fBdefault_bar_size\fR\*(T>\fR
+Specify a default width and height for bars. Example: 'default_bar_size 0 6'. This is particularly useful for execbar and execibar as they do not take size arguments
+
+.TP
+\fB\*(T<\fBdefault_graph_size\fR\*(T>\fR
+Specify a default width and height for graphs. Example: 'default_graph_size 0 25'. This is particularly useful for execgraph and execigraph as they do not take size arguments
+
+.TP
+\fB\*(T<\fBdefault_gauge_size\fR\*(T>\fR
+Specify a default width and height for gauges. Example: 'default_gauge_size 25 25'. This is particularly useful for execgauge and execigauge as they do not take size arguments
+
+.TP
\fB\*(T<\fBdefault_color\fR\*(T>\fR
Default color and border color
syntax "conky" "(\.*conkyrc.*$|conky.conf)"
## Configuration items
-color green "\<(alias|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|out_to_x|extra_newline|overwrite_file|append_file|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 "\<(alias|alignment|background|show_graph_range|show_graph_scale|border_margin|border_width|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|default_bar_size|default_gauge_size|default_graph_size|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|out_to_x|extra_newline|overwrite_file|append_file|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)\>"
\ color7
\ color8
\ color9
+ \ default_bar_size
+ \ default_gauge_size
+ \ default_graph_size
\ default_color
\ default_shade_color
\ default_shadecolor
static void load_config_file(const char *f)
{
#define CONF_ERR ERR("%s: %d: config file error", f, line)
+#define CONF_ERR2(a) ERR("%s: %d: config file error: %s", f, line, a)
int line = 0;
FILE *fp;
CONF_ERR;
}
}
+ CONF("default_bar_size") {
+ char err = 0;
+ if (value) {
+ if (sscanf(value, "%d %d", &default_bar_width, &default_bar_height) != 2) {
+ err = 1;
+ }
+ } else {
+ err = 1;
+ }
+ if (err) {
+ CONF_ERR2("default_bar_size takes 2 integer arguments (ie. 'default_bar_size 0 6')")
+ }
+ }
+ 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") {
+ char err = 0;
+ if (value) {
+ if (sscanf(value, "%d %d", &default_gauge_width, &default_gauge_height) != 2) {
+ err = 1;
+ }
+ } else {
+ err = 1;
+ }
+ if (err) {
+ CONF_ERR2("default_gauge_size takes 2 integer arguments (ie. 'default_gauge_size 0 6')")
+ }
+ }
#ifdef MPD
CONF("mpd_host") {
if (value) {
unsigned int special_count;
+int default_bar_width = 0, default_bar_height = 6;
+int default_graph_width = 25, default_graph_height = 25;
+int default_gauge_width = 0, default_gauge_height = 25;
+
/*
* Scanning arguments to various special text objects
*/
const char *scan_gauge(const char *args, int *w, int *h)
{
/*width and height*/
- *w = 25;
- *h = 25;
+ *w = default_gauge_width;
+ *h = default_gauge_height;
/* gauge's argument is either height or height,width */
if (args) {
const char *scan_bar(const char *args, int *w, int *h)
{
/* zero width means all space that is available */
- *w = 0;
- *h = 6;
+ *w = default_bar_width;
+ *h = default_bar_height;
/* bar's argument is either height or height,width */
if (args) {
int n = 0;
buf[0] = 0;
/* zero width means all space that is available */
- *w = 0;
- *h = 25;
+ *w = default_graph_width;
+ *h = default_graph_height;
*first_colour = 0;
*last_colour = 0;
*scale = 0;
extern struct special_t *specials;
extern unsigned int special_count;
+extern int default_bar_width;
+extern int default_bar_height;
+extern int default_graph_width;
+extern int default_graph_height;
+extern int default_gauge_width;
+extern int default_gauge_height;
+
/* max number of specials allowed (TODO: use linked list instead) */
extern unsigned int max_specials;