dnl Some defines
dnl
-AC_DEFINE(DEFAULTNETDEV, "eth0", [Set to the default networkdevice])
+AC_DEFINE(DEFAULTNETDEV, "eth0", [Default networkdevice])
+AC_DEFINE(CONFIG_FILE, "$HOME/.conkyrc", [Configfile of the user])
dnl
dnl Some functions
#define S_ISSOCK(x) ((x & S_IFMT) == S_IFSOCK)
#endif
-#define CONFIG_FILE "$HOME/.conkyrc"
#define MAIL_FILE "$MAIL"
#define MAX_IF_BLOCK_DEPTH 5
#define MAX_TAIL_LINES 100
static void print_version(void)
{
- printf("Conky %s compiled %s for %s\n", VERSION, BUILD_DATE, BUILD_ARCH);
+ printf(PACKAGE_NAME" "VERSION" compiled "BUILD_DATE" for "BUILD_ARCH"\n");
printf("\nCompiled in features:\n\n"
- "System config file: %s\n\n"
+ "System config file: "SYSTEM_CONFIG_FILE"\n\n"
#ifdef X11
" X11:\n"
# ifdef HAVE_XDAMAGE
#ifdef NVIDIA
" * nvidia\n"
#endif
- "", SYSTEM_CONFIG_FILE
);
exit(0);
return NULL;
} else if (n2 < 1 || n2 < update_interval) {
CRIT_ERR("invalid arg for tail, interval must be greater than "
- "0 and Conky's interval");
+ "0 and "PACKAGE_NAME"'s interval");
return NULL;
} else {
FILE *fp = 0;
return NULL;
} else if (n2 < 1 || n2 < update_interval) {
CRIT_ERR("invalid arg for head, interval must be greater than "
- "0 and Conky's interval");
+ "0 and "PACKAGE_NAME"'s interval");
return NULL;
} else {
FILE *fp;
own_window = 0;
window.type = TYPE_NORMAL;
window.hints = 0;
- strcpy(window.class_name, "Conky");
+ strcpy(window.class_name, PACKAGE_NAME);
update_uname();
- sprintf(window.title, "Conky (%s)", info.uname_s.nodename);
+ sprintf(window.title, PACKAGE_NAME" (%s)", info.uname_s.nodename);
#endif
stippled_borders = 0;
border_margin = 3;
static void print_help(const char *prog_name) {
printf("Usage: %s [OPTION]...\n"
- "Conky is a system monitor that renders text on desktop or to own transparent\n"
+ PACKAGE_NAME" is a system monitor that renders text on desktop or to own transparent\n"
"window. Command line options will override configurations defined in config\n"
"file.\n"
" -v, --version version\n"
#endif /* X11 */
" -t, --text=TEXT text to render, remember single quotes, like -t '$uptime'\n"
" -u, --interval=SECS update interval\n"
- " -i COUNT number of times to update Conky (and quit)\n",
+ " -i COUNT number of times to update "PACKAGE_NAME" (and quit)\n",
prog_name
);
}
switch (pid) {
case -1:
- ERR("Conky: couldn't fork() to background: %s",
+ ERR(PACKAGE_NAME": couldn't fork() to background: %s",
strerror(errno));
break;
default:
/* parent process */
- fprintf(stderr, "Conky: forked to background, pid is %d\n",
+ fprintf(stderr, PACKAGE_NAME": forked to background, pid is %d\n",
pid);
fflush(stderr);
return 0;
#include <sys/socket.h>
#define ERR(...) { \
- fprintf(stderr, "Conky: "); \
+ fprintf(stderr, PACKAGE_NAME": "); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
}
fd = open(path, O_RDONLY);
if (fd < 0) {
CRIT_ERR("can't open '%s': %s\nplease check your device or remove this "
- "var from Conky", path, strerror(errno));
+ "var from "PACKAGE_NAME, path, strerror(errno));
}
if (strcmp(type, "in") == 0 || strcmp(type, "temp") == 0
// open the CPU information file
f = open_file("/proc/cpuinfo", &rep);
if (!f) {
- perror("Conky: Failed to access '/proc/cpuinfo' at get_freq()");
+ perror(PACKAGE_NAME": Failed to access '/proc/cpuinfo' at get_freq()");
return 0;
}
}
fclose(f);
} else {
- fprintf(stderr, "Conky: Failed to access '%s' at ", current_freq_file);
+ fprintf(stderr, PACKAGE_NAME": Failed to access '%s' at ", current_freq_file);
perror("get_voltage()");
if (f) {
fclose(f);
}
fclose(f);
} else {
- fprintf(stderr, "Conky: Failed to access '%s' at ", current_freq_file);
+ fprintf(stderr, PACKAGE_NAME": Failed to access '%s' at ", current_freq_file);
perror("get_voltage()");
if (f) {
fclose(f);
}
} else {
CRIT_ERR("can't open '%s': %s\nYou are not using the IBM ACPI. Remove "
- "ibm* from your Conky config file.", fan, strerror(errno));
+ "ibm* from your "PACKAGE_NAME" config file.", fan, strerror(errno));
}
fclose(fp);
}
} else {
CRIT_ERR("can't open '%s': %s\nYou are not using the IBM ACPI. Remove "
- "ibm* from your Conky config file.", thermal, strerror(errno));
+ "ibm* from your "PACKAGE_NAME" config file.", thermal, strerror(errno));
}
fclose(fp);
}
} else {
CRIT_ERR("can't open '%s': %s\nYou are not using the IBM ACPI. Remove "
- "ibm* from your Conky config file.", volume, strerror(errno));
+ "ibm* from your "PACKAGE_NAME" config file.", volume, strerror(errno));
}
fclose(fp);
}
} else {
CRIT_ERR("can't open '%s': %s\nYou are not using the IBM ACPI. Remove "
- "ibm* from your Conky config file.", filename, strerror(errno));
+ "ibm* from your "PACKAGE_NAME" config file.", filename, strerror(errno));
}
fclose(fp);
XFree(buf);
XFree(children);
fprintf(stderr,
- "Conky: desktop window (%lx) found from __SWM_VROOT property\n",
+ PACKAGE_NAME": desktop window (%lx) found from __SWM_VROOT property\n",
win);
fflush(stderr);
*p_root = win;
if (win != root) {
fprintf(stderr,
- "Conky: desktop window (%lx) is subwindow of root window (%lx)\n",
+ PACKAGE_NAME": desktop window (%lx) is subwindow of root window (%lx)\n",
win, root);
} else {
- fprintf(stderr, "Conky: desktop window (%lx) is root window\n", win);
+ fprintf(stderr, PACKAGE_NAME": desktop window (%lx) is root window\n", win);
}
fflush(stderr);
XLowerWindow(display, window.window);
- fprintf(stderr, "Conky: window type - override\n");
+ fprintf(stderr, PACKAGE_NAME": window type - override\n");
fflush(stderr);
} else { /* window.type != TYPE_OVERRIDE */
switch (window.type) {
case TYPE_DESKTOP:
prop = ATOM(_NET_WM_WINDOW_TYPE_DESKTOP);
- fprintf(stderr, "Conky: window type - desktop\n");
+ fprintf(stderr, PACKAGE_NAME": window type - desktop\n");
fflush(stderr);
break;
case TYPE_DOCK:
prop = ATOM(_NET_WM_WINDOW_TYPE_DOCK);
- fprintf(stderr, "Conky: window type - dock\n");
+ fprintf(stderr, PACKAGE_NAME": window type - dock\n");
fflush(stderr);
break;
case TYPE_NORMAL:
default:
prop = ATOM(_NET_WM_WINDOW_TYPE_NORMAL);
- fprintf(stderr, "Conky: window type - normal\n");
+ fprintf(stderr, PACKAGE_NAME": window type - normal\n");
fflush(stderr);
break;
}
/* Window decorations */
if (TEST_HINT(window.hints, HINT_UNDECORATED)) {
- /* fprintf(stderr, "Conky: hint - undecorated\n");
+ /* fprintf(stderr, PACKAGE_NAME": hint - undecorated\n");
fflush(stderr); */
xa = ATOM(_MOTIF_WM_HINTS);
/* Below other windows */
if (TEST_HINT(window.hints, HINT_BELOW)) {
- /* fprintf(stderr, "Conky: hint - below\n");
+ /* fprintf(stderr, PACKAGE_NAME": hint - below\n");
fflush(stderr); */
xa = ATOM(_WIN_LAYER);
/* Above other windows */
if (TEST_HINT(window.hints, HINT_ABOVE)) {
- /* fprintf(stderr, "Conky: hint - above\n");
+ /* fprintf(stderr, PACKAGE_NAME": hint - above\n");
fflush(stderr); */
xa = ATOM(_WIN_LAYER);
/* Sticky */
if (TEST_HINT(window.hints, HINT_STICKY)) {
- /* fprintf(stderr, "Conky: hint - sticky\n");
+ /* fprintf(stderr, PACKAGE_NAME": hint - sticky\n");
fflush(stderr); */
xa = ATOM(_NET_WM_DESKTOP);
/* Skip taskbar */
if (TEST_HINT(window.hints, HINT_SKIP_TASKBAR)) {
- /* fprintf(stderr, "Conky: hint - skip_taskbar\n");
+ /* fprintf(stderr, PACKAGE_NAME": hint - skip_taskbar\n");
fflush(stderr); */
xa = ATOM(_NET_WM_STATE);
/* Skip pager */
if (TEST_HINT(window.hints, HINT_SKIP_PAGER)) {
- /* fprintf(stderr, "Conky: hint - skip_pager\n");
+ /* fprintf(stderr, PACKAGE_NAME": hint - skip_pager\n");
fflush(stderr); */
xa = ATOM(_NET_WM_STATE);
}
} /* else { window.type != TYPE_OVERRIDE */
- fprintf(stderr, "Conky: drawing to created window (0x%lx)\n",
+ fprintf(stderr, PACKAGE_NAME": drawing to created window (0x%lx)\n",
window.window);
fflush(stderr);
window.height = attrs.height;
}
- fprintf(stderr, "Conky: drawing to desktop window\n");
+ fprintf(stderr, PACKAGE_NAME": drawing to desktop window\n");
}
/* Drawable is same as window. This may be changed by double buffering. */
window.window, XdbeBackground);
if (window.back_buffer != None) {
window.drawable = window.back_buffer;
- fprintf(stderr, "Conky: drawing to double buffer\n");
+ fprintf(stderr, PACKAGE_NAME": drawing to double buffer\n");
} else {
use_xdbe = 0;
}
}
}
if (!use_xdbe) {
- fprintf(stderr, "Conky: drawing to single buffer\n");
+ fprintf(stderr, PACKAGE_NAME": drawing to single buffer\n");
}
#endif
struct information *ptr = p;
ptr->xmms2_conn_state = CONN_NO;
- fprintf(stderr,"Conky: xmms2 connection failed. %s\n",
+ fprintf(stderr,PACKAGE_NAME": xmms2 connection failed. %s\n",
xmmsc_get_last_error ( ptr->xmms2_conn ));
fflush(stderr);
if (current_info->xmms2_conn_state == CONN_INIT) {
if (current_info->xmms2_conn == NULL) {
- current_info->xmms2_conn = xmmsc_init("conky");
+ current_info->xmms2_conn = xmmsc_init(PACKAGE);
}
/* did init fail? */
if (current_info->xmms2_conn == NULL) {
- fprintf(stderr, "Conky: xmms2 init failed. %s\n",
+ fprintf(stderr, PACKAGE_NAME": xmms2 init failed. %s\n",
xmmsc_get_last_error(current_info->xmms2_conn));
fflush(stderr);
return;
/* clear all values */
xmms_clear(current_info);
- /* fprintf(stderr, "Conky: xmms2 init ok.\n");
+ /* fprintf(stderr, PACKAGE_NAME": xmms2 init ok.\n");
fflush(stderr); */
}
char *path = getenv("XMMS_PATH");
if (!xmmsc_connect(current_info->xmms2_conn, path)) {
- fprintf(stderr, "Conky: xmms2 connection failed. %s\n",
+ fprintf(stderr, PACKAGE_NAME": xmms2 connection failed. %s\n",
xmmsc_get_last_error(current_info->xmms2_conn));
fflush(stderr);
current_info->xmms2_conn_state = CONN_NO;
/* everything seems to be ok */
current_info->xmms2_conn_state = CONN_OK;
- /* fprintf(stderr, "Conky: xmms2 connected.\n");
+ /* fprintf(stderr, PACKAGE_NAME": xmms2 connected.\n");
fflush(stderr); */
}