1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-02-05 05:28:32 +00:00

made defines of some literal values and defines to configure.ac.in

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1223 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Nikolas Garofil 2008-07-12 10:25:05 +00:00
parent 8745d71edf
commit 23321c408d
6 changed files with 44 additions and 45 deletions

View File

@ -525,7 +525,8 @@ dnl
dnl Some defines dnl Some defines
dnl 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
dnl Some functions dnl Some functions

View File

@ -66,7 +66,6 @@
#define S_ISSOCK(x) ((x & S_IFMT) == S_IFSOCK) #define S_ISSOCK(x) ((x & S_IFMT) == S_IFSOCK)
#endif #endif
#define CONFIG_FILE "$HOME/.conkyrc"
#define MAIL_FILE "$MAIL" #define MAIL_FILE "$MAIL"
#define MAX_IF_BLOCK_DEPTH 5 #define MAX_IF_BLOCK_DEPTH 5
#define MAX_TAIL_LINES 100 #define MAX_TAIL_LINES 100
@ -78,10 +77,10 @@ static void print_version(void) __attribute__((noreturn));
static void print_version(void) 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" printf("\nCompiled in features:\n\n"
"System config file: %s\n\n" "System config file: "SYSTEM_CONFIG_FILE"\n\n"
#ifdef X11 #ifdef X11
" X11:\n" " X11:\n"
# ifdef HAVE_XDAMAGE # ifdef HAVE_XDAMAGE
@ -132,7 +131,6 @@ static void print_version(void)
#ifdef NVIDIA #ifdef NVIDIA
" * nvidia\n" " * nvidia\n"
#endif #endif
"", SYSTEM_CONFIG_FILE
); );
exit(0); exit(0);
@ -3259,7 +3257,7 @@ static struct text_object *construct_text_object(const char *s,
return NULL; return NULL;
} else if (n2 < 1 || n2 < update_interval) { } else if (n2 < 1 || n2 < update_interval) {
CRIT_ERR("invalid arg for tail, interval must be greater than " CRIT_ERR("invalid arg for tail, interval must be greater than "
"0 and Conky's interval"); "0 and "PACKAGE_NAME"'s interval");
return NULL; return NULL;
} else { } else {
FILE *fp = 0; FILE *fp = 0;
@ -3341,7 +3339,7 @@ static struct text_object *construct_text_object(const char *s,
return NULL; return NULL;
} else if (n2 < 1 || n2 < update_interval) { } else if (n2 < 1 || n2 < update_interval) {
CRIT_ERR("invalid arg for head, interval must be greater than " CRIT_ERR("invalid arg for head, interval must be greater than "
"0 and Conky's interval"); "0 and "PACKAGE_NAME"'s interval");
return NULL; return NULL;
} else { } else {
FILE *fp; FILE *fp;
@ -7978,9 +7976,9 @@ static void set_default_configurations(void)
own_window = 0; own_window = 0;
window.type = TYPE_NORMAL; window.type = TYPE_NORMAL;
window.hints = 0; window.hints = 0;
strcpy(window.class_name, "Conky"); strcpy(window.class_name, PACKAGE_NAME);
update_uname(); update_uname();
sprintf(window.title, "Conky (%s)", info.uname_s.nodename); sprintf(window.title, PACKAGE_NAME" (%s)", info.uname_s.nodename);
#endif #endif
stippled_borders = 0; stippled_borders = 0;
border_margin = 3; border_margin = 3;
@ -8696,7 +8694,7 @@ static void load_config_file(const char *f)
static void print_help(const char *prog_name) { static void print_help(const char *prog_name) {
printf("Usage: %s [OPTION]...\n" 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" "window. Command line options will override configurations defined in config\n"
"file.\n" "file.\n"
" -v, --version version\n" " -v, --version version\n"
@ -8719,7 +8717,7 @@ static void print_help(const char *prog_name) {
#endif /* X11 */ #endif /* X11 */
" -t, --text=TEXT text to render, remember single quotes, like -t '$uptime'\n" " -t, --text=TEXT text to render, remember single quotes, like -t '$uptime'\n"
" -u, --interval=SECS update interval\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 prog_name
); );
} }
@ -8991,7 +8989,7 @@ int main(int argc, char **argv)
switch (pid) { switch (pid) {
case -1: case -1:
ERR("Conky: couldn't fork() to background: %s", ERR(PACKAGE_NAME": couldn't fork() to background: %s",
strerror(errno)); strerror(errno));
break; break;
@ -9004,7 +9002,7 @@ int main(int argc, char **argv)
default: default:
/* parent process */ /* parent process */
fprintf(stderr, "Conky: forked to background, pid is %d\n", fprintf(stderr, PACKAGE_NAME": forked to background, pid is %d\n",
pid); pid);
fflush(stderr); fflush(stderr);
return 0; return 0;

View File

@ -107,7 +107,7 @@ extern unsigned int text_buffer_size;
#include <sys/socket.h> #include <sys/socket.h>
#define ERR(...) { \ #define ERR(...) { \
fprintf(stderr, "Conky: "); \ fprintf(stderr, PACKAGE_NAME": "); \
fprintf(stderr, __VA_ARGS__); \ fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \ fprintf(stderr, "\n"); \
} }

View File

@ -889,7 +889,7 @@ int open_sysfs_sensor(const char *dir, const char *dev, const char *type, int n,
fd = open(path, O_RDONLY); fd = open(path, O_RDONLY);
if (fd < 0) { if (fd < 0) {
CRIT_ERR("can't open '%s': %s\nplease check your device or remove this " 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 if (strcmp(type, "in") == 0 || strcmp(type, "temp") == 0
@ -1150,7 +1150,7 @@ char get_freq(char *p_client_buffer, size_t client_buffer_size,
// open the CPU information file // open the CPU information file
f = open_file("/proc/cpuinfo", &rep); f = open_file("/proc/cpuinfo", &rep);
if (!f) { 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; return 0;
} }
@ -1240,7 +1240,7 @@ char get_voltage(char *p_client_buffer, size_t client_buffer_size,
} }
fclose(f); fclose(f);
} else { } 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()"); perror("get_voltage()");
if (f) { if (f) {
fclose(f); fclose(f);
@ -1268,7 +1268,7 @@ char get_voltage(char *p_client_buffer, size_t client_buffer_size,
} }
fclose(f); fclose(f);
} else { } 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()"); perror("get_voltage()");
if (f) { if (f) {
fclose(f); fclose(f);
@ -2193,7 +2193,7 @@ void get_ibm_acpi_fan(char *p_client_buffer, size_t client_buffer_size)
} }
} else { } else {
CRIT_ERR("can't open '%s': %s\nYou are not using the IBM ACPI. Remove " 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); fclose(fp);
@ -2257,7 +2257,7 @@ void get_ibm_acpi_temps(void)
} }
} else { } else {
CRIT_ERR("can't open '%s': %s\nYou are not using the IBM ACPI. Remove " 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); fclose(fp);
@ -2305,7 +2305,7 @@ void get_ibm_acpi_volume(char *p_client_buffer, size_t client_buffer_size)
} }
} else { } else {
CRIT_ERR("can't open '%s': %s\nYou are not using the IBM ACPI. Remove " 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); fclose(fp);
@ -2354,7 +2354,7 @@ void get_ibm_acpi_brightness(char *p_client_buffer, size_t client_buffer_size)
} }
} else { } else {
CRIT_ERR("can't open '%s': %s\nYou are not using the IBM ACPI. Remove " 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); fclose(fp);

View File

@ -139,7 +139,7 @@ static Window find_desktop_window(Window *p_root, Window *p_desktop)
XFree(buf); XFree(buf);
XFree(children); XFree(children);
fprintf(stderr, fprintf(stderr,
"Conky: desktop window (%lx) found from __SWM_VROOT property\n", PACKAGE_NAME": desktop window (%lx) found from __SWM_VROOT property\n",
win); win);
fflush(stderr); fflush(stderr);
*p_root = win; *p_root = win;
@ -168,10 +168,10 @@ static Window find_desktop_window(Window *p_root, Window *p_desktop)
if (win != root) { if (win != root) {
fprintf(stderr, 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); win, root);
} else { } 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); fflush(stderr);
@ -238,7 +238,7 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
XLowerWindow(display, window.window); XLowerWindow(display, window.window);
fprintf(stderr, "Conky: window type - override\n"); fprintf(stderr, PACKAGE_NAME": window type - override\n");
fflush(stderr); fflush(stderr);
} else { /* window.type != TYPE_OVERRIDE */ } else { /* window.type != TYPE_OVERRIDE */
@ -279,18 +279,18 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
switch (window.type) { switch (window.type) {
case TYPE_DESKTOP: case TYPE_DESKTOP:
prop = ATOM(_NET_WM_WINDOW_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); fflush(stderr);
break; break;
case TYPE_DOCK: case TYPE_DOCK:
prop = ATOM(_NET_WM_WINDOW_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); fflush(stderr);
break; break;
case TYPE_NORMAL: case TYPE_NORMAL:
default: default:
prop = ATOM(_NET_WM_WINDOW_TYPE_NORMAL); prop = ATOM(_NET_WM_WINDOW_TYPE_NORMAL);
fprintf(stderr, "Conky: window type - normal\n"); fprintf(stderr, PACKAGE_NAME": window type - normal\n");
fflush(stderr); fflush(stderr);
break; break;
} }
@ -302,7 +302,7 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
/* Window decorations */ /* Window decorations */
if (TEST_HINT(window.hints, HINT_UNDECORATED)) { if (TEST_HINT(window.hints, HINT_UNDECORATED)) {
/* fprintf(stderr, "Conky: hint - undecorated\n"); /* fprintf(stderr, PACKAGE_NAME": hint - undecorated\n");
fflush(stderr); */ fflush(stderr); */
xa = ATOM(_MOTIF_WM_HINTS); xa = ATOM(_MOTIF_WM_HINTS);
@ -315,7 +315,7 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
/* Below other windows */ /* Below other windows */
if (TEST_HINT(window.hints, HINT_BELOW)) { if (TEST_HINT(window.hints, HINT_BELOW)) {
/* fprintf(stderr, "Conky: hint - below\n"); /* fprintf(stderr, PACKAGE_NAME": hint - below\n");
fflush(stderr); */ fflush(stderr); */
xa = ATOM(_WIN_LAYER); xa = ATOM(_WIN_LAYER);
@ -337,7 +337,7 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
/* Above other windows */ /* Above other windows */
if (TEST_HINT(window.hints, HINT_ABOVE)) { if (TEST_HINT(window.hints, HINT_ABOVE)) {
/* fprintf(stderr, "Conky: hint - above\n"); /* fprintf(stderr, PACKAGE_NAME": hint - above\n");
fflush(stderr); */ fflush(stderr); */
xa = ATOM(_WIN_LAYER); xa = ATOM(_WIN_LAYER);
@ -359,7 +359,7 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
/* Sticky */ /* Sticky */
if (TEST_HINT(window.hints, HINT_STICKY)) { if (TEST_HINT(window.hints, HINT_STICKY)) {
/* fprintf(stderr, "Conky: hint - sticky\n"); /* fprintf(stderr, PACKAGE_NAME": hint - sticky\n");
fflush(stderr); */ fflush(stderr); */
xa = ATOM(_NET_WM_DESKTOP); xa = ATOM(_NET_WM_DESKTOP);
@ -381,7 +381,7 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
/* Skip taskbar */ /* Skip taskbar */
if (TEST_HINT(window.hints, HINT_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); */ fflush(stderr); */
xa = ATOM(_NET_WM_STATE); xa = ATOM(_NET_WM_STATE);
@ -395,7 +395,7 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
/* Skip pager */ /* Skip pager */
if (TEST_HINT(window.hints, HINT_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); */ fflush(stderr); */
xa = ATOM(_NET_WM_STATE); xa = ATOM(_NET_WM_STATE);
@ -408,7 +408,7 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
} }
} /* else { window.type != TYPE_OVERRIDE */ } /* 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); window.window);
fflush(stderr); fflush(stderr);
@ -428,7 +428,7 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
window.height = attrs.height; 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. */ /* Drawable is same as window. This may be changed by double buffering. */
@ -445,7 +445,7 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
window.window, XdbeBackground); window.window, XdbeBackground);
if (window.back_buffer != None) { if (window.back_buffer != None) {
window.drawable = window.back_buffer; window.drawable = window.back_buffer;
fprintf(stderr, "Conky: drawing to double buffer\n"); fprintf(stderr, PACKAGE_NAME": drawing to double buffer\n");
} else { } else {
use_xdbe = 0; use_xdbe = 0;
} }
@ -455,7 +455,7 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
} }
} }
if (!use_xdbe) { if (!use_xdbe) {
fprintf(stderr, "Conky: drawing to single buffer\n"); fprintf(stderr, PACKAGE_NAME": drawing to single buffer\n");
} }
#endif #endif

View File

@ -102,7 +102,7 @@ void connection_lost(void *p)
struct information *ptr = p; struct information *ptr = p;
ptr->xmms2_conn_state = CONN_NO; 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 )); xmmsc_get_last_error ( ptr->xmms2_conn ));
fflush(stderr); fflush(stderr);
@ -269,12 +269,12 @@ void update_xmms2()
if (current_info->xmms2_conn_state == CONN_INIT) { if (current_info->xmms2_conn_state == CONN_INIT) {
if (current_info->xmms2_conn == NULL) { if (current_info->xmms2_conn == NULL) {
current_info->xmms2_conn = xmmsc_init("conky"); current_info->xmms2_conn = xmmsc_init(PACKAGE);
} }
/* did init fail? */ /* did init fail? */
if (current_info->xmms2_conn == NULL) { 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)); xmmsc_get_last_error(current_info->xmms2_conn));
fflush(stderr); fflush(stderr);
return; return;
@ -286,7 +286,7 @@ void update_xmms2()
/* clear all values */ /* clear all values */
xmms_clear(current_info); xmms_clear(current_info);
/* fprintf(stderr, "Conky: xmms2 init ok.\n"); /* fprintf(stderr, PACKAGE_NAME": xmms2 init ok.\n");
fflush(stderr); */ fflush(stderr); */
} }
@ -296,7 +296,7 @@ void update_xmms2()
char *path = getenv("XMMS_PATH"); char *path = getenv("XMMS_PATH");
if (!xmmsc_connect(current_info->xmms2_conn, 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)); xmmsc_get_last_error(current_info->xmms2_conn));
fflush(stderr); fflush(stderr);
current_info->xmms2_conn_state = CONN_NO; current_info->xmms2_conn_state = CONN_NO;
@ -329,7 +329,7 @@ void update_xmms2()
/* everything seems to be ok */ /* everything seems to be ok */
current_info->xmms2_conn_state = CONN_OK; current_info->xmms2_conn_state = CONN_OK;
/* fprintf(stderr, "Conky: xmms2 connected.\n"); /* fprintf(stderr, PACKAGE_NAME": xmms2 connected.\n");
fflush(stderr); */ fflush(stderr); */
} }