# $Id$
+2008-10-23
+ * Externalize default config file: ${sysconfdir}/conky/conky.conf
+
2008-10-21
* Initialize music_player_interval so built-in .conkyrc actual works.
* Lower timed_thread minimum timing interval from 50 usecs to 10 usecs.
+# Conky, a system monitor, based on torsmo
+#
+# Any original torsmo code is licensed under the BSD license
+#
+# All code written since the fork of torsmo is licensed under the GPL
+#
+# Please see COPYING for details
+#
+# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
+# Copyright (c) 2005-2007 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
+# All rights reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# $Id$
+
SUBDIRS = \
src \
- doc
+ doc \
+ data
AUTOMAKE_OPTIONS = \
1.8 \
#!/bin/sh
+#
+# Conky, a system monitor, based on torsmo
+#
+# Any original torsmo code is licensed under the BSD license
+#
+# All code written since the fork of torsmo is licensed under the GPL
+#
+# Please see COPYING for details
+#
+# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
+# Copyright (c) 2005-2007 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
+# All rights reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
# $Id$
-
-# autogen.sh
#
# optional $1 = optional directory containing build tree or svn working copy
AC_CONFIG_FILES(
Makefile
+ data/Makefile
doc/Makefile
src/Makefile
src/build.h
$PACKAGE $VERSION configured successfully:
Installing into: $prefix
+ System config dir: $sysconfdir
C compiler flags: $CFLAGS
Linker flags: $LDFLAGS
Libraries: $LIBS
--- /dev/null
+# Conky, a system monitor, based on torsmo
+#
+# Any original torsmo code is licensed under the BSD license
+#
+# All code written since the fork of torsmo is licensed under the GPL
+#
+# Please see COPYING for details
+#
+# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
+# Copyright (c) 2005-2007 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
+# All rights reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# $Id$
+
+configdir = ${sysconfdir}/conky
+dist_config_DATA = conky.conf
+
+# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
--- /dev/null
+alignment bottom_left
+background no
+border_width 1
+cpu_avg_samples 2
+default_color white
+default_outline_color white
+default_shade_color white
+draw_borders no
+draw_graph_borders yes
+draw_outline no
+draw_shades no
+font 6x10
+gap_x 5
+gap_y 60
+minimum_size 5 5
+net_avg_samples 2
+no_buffers yes
+out_to_console no
+own_window yes
+own_window_class Conky
+own_window_type normal
+stippled_borders 0
+update_interval 3.0
+uppercase no
+use_spacer no
+
+TEXT
+$nodename - $sysname $kernel on $machine
+$hr
+${color grey}Uptime:$color $uptime
+${color grey}Frequency (in MHz):$color $freq
+${color grey}Frequency (in GHz):$color $freq_g
+${color grey}RAM Usage:$color $mem/$memmax - $memperc% ${membar 4}
+${color grey}Swap Usage:$color $swap/$swapmax - $swapperc% ${swapbar 4}
+${color grey}CPU Usage:$color $cpu% ${cpubar 4}
+${color grey}Processes:$color $processes ${color grey}Running:$color $running_processes
+$hr
+${color grey}File systems:
+ / $color${fs_free /}/${fs_size /} ${fs_bar 6 /}
+${color grey}Networking:
+Up:$color ${upspeed eth0} k/s${color grey} - Down:$color ${downspeed eth0} k/s
+$hr
+${color grey}Name PID CPU% MEM%
+${color lightgrey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
+${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
+${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
+${color lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
+
+# Conky, a system monitor, based on torsmo
+#
+# Any original torsmo code is licensed under the BSD license
+#
+# All code written since the fork of torsmo is licensed under the GPL
+#
+# Please see COPYING for details
+#
+# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
+# Copyright (c) 2005-2007 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
+# All rights reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# $Id$
+
+INCLUDES = \
+ -DSYSTEM_CONFIG_FILE=\"$(sysconfdir)/conky/conky.conf\"
+
bin_PROGRAMS = conky
if BUILD_AUDACIOUS
tcp_port_monitor_args_t tcp_port_monitor_args;
#endif
-/* Text that is shown */
-static char original_text[] =
- "$nodename - $sysname $kernel on $machine\n"
- "$hr\n"
- "${color grey}Uptime:$color $uptime\n"
- "${color grey}Frequency (in MHz):$color $freq\n"
- "${color grey}Frequency (in GHz):$color $freq_g\n"
- "${color grey}RAM Usage:$color $mem/$memmax - $memperc% ${membar 4}\n"
- "${color grey}Swap Usage:$color $swap/$swapmax - $swapperc% ${swapbar 4}\n"
- "${color grey}CPU Usage:$color $cpu% ${cpubar 4}\n"
- "${color grey}Processes:$color $processes ${color grey}Running:$color $running_processes\n"
- "$hr\n"
- "${color grey}File systems:\n"
- " / $color${fs_free /}/${fs_size /} ${fs_bar 6 /}\n"
- "${color grey}Networking:\n"
- " Up:$color ${upspeed eth0} k/s${color grey} - Down:$color ${downspeed eth0} k/s\n"
- "$hr\n"
-#ifdef MPD
- "${color grey}MPD: $mpd_status $mpd_artist - $mpd_title from $mpd_album at $mpd_vol\n"
- "Bitrate: $mpd_bitrate\n" "Progress: $mpd_bar\n"
-#endif
-#ifdef XMMS2
- "${color grey}XMMS2: $xmms2_status $xmms2_artist - $xmms2_title from $xmms2_album\n"
- "Progress: $xmms2_bar\n"
-#endif
- "${color grey}Name PID CPU% MEM%\n"
- " ${color lightgrey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}\n"
- " ${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}\n"
- " ${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}\n"
- " ${color lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}\n"
- ;
-
-static char *text = original_text;
+static char *text = 0;
long text_lines;
static int total_updates;
text_object_count = 0;
text_objects = NULL;
- if (text != original_text)
+ if (!text)
free(text);
free(current_config);
draw_outline = 0;
set_first_font("6x10");
gap_x = 5;
- gap_y = 5;
+ gap_y = 60;
minimum_width = 5;
minimum_height = 5;
maximum_width = 0;
window.hints=0;
strcpy(window.class_name, "Conky");
update_uname();
- sprintf(window.title,"%s - conky",info.uname_s.nodename);
+ sprintf(window.title,"Conky (%s)",info.uname_s.nodename);
#endif
stippled_borders = 0;
border_margin = 3;
CONF_ERR;
}
CONF("text") {
- if (text != original_text)
+ if (!text)
free(text);
text = (char *)
case 'V':
print_version();
case 'c':
- /* if current_config is set to a strdup of CONFIG_FILE, free it (even
- * though free() does the NULL check itself;), then load optarg value */
if (current_config)
free(current_config);
current_config = strdup(optarg);
"window. Command line options will override configurations defined in config\n"
"file.\n"
" -V version\n"
- " -c FILE config file to load instead of "
- CONFIG_FILE
- "\n"
+ " -c FILE config file to load\n"
" -d daemonize, fork to background\n"
" -h help\n"
#ifdef X11
init_X11();
#endif /* X11 */
- /* load current_config or CONFIG_FILE */
+ /* load current_config, CONFIG_FILE or SYSTEM_CONFIG_FILE */
-#ifdef CONFIG_FILE
- if (current_config == NULL) {
+ if (!current_config) {
/* load default config file */
char buf[256];
+ FILE *fp;
- variable_substitute(CONFIG_FILE, buf, 256);
+ /* Try to use personal config file first */
+ variable_substitute(CONFIG_FILE, buf, sizeof(buf));
+ if (buf[0] && (fp=fopen(buf,"r"))) {
+ current_config = strdup(buf);
+ fclose(fp);
+ }
- if (buf[0] != '\0')
- current_config = strdup(buf);
- }
-#endif
+ /* Try to use system config file if personal config not readable */
+ if (!current_config && (fp=fopen(SYSTEM_CONFIG_FILE,"r"))) {
+ current_config = strdup(SYSTEM_CONFIG_FILE);
+ fclose(fp);
+ }
- if (current_config != NULL && fopen((const char *)current_config, (const char *)"r"))
- load_config_file(current_config);
- else {
- set_default_configurations();
+ /* No readable config found */
+ if (!current_config)
+ CRIT_ERR("no readable personal or system-wide config file found");
}
+ load_config_file(current_config);
+
/* init specials array */
if ((specials = calloc (sizeof(struct special_t), max_specials)) == 0)
ERR("failed to create specials array");
#endif
#endif /* X11 */
case 't':
- if (text != original_text)
+ if (!text)
free(text);
text = strdup(optarg);
convert_escapes(text);
/* generate text and get initial size */
extract_variable_text(text);
- if (text != original_text) {
+ if (!text) {
free(text);
}
text = NULL;