2008-02-20 20:30:45 +00:00
|
|
|
/* Conky, a system monitor, based on torsmo
|
2005-08-05 01:06:17 +00:00
|
|
|
*
|
2007-08-10 19:53:44 +00:00
|
|
|
* 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
|
2008-03-31 04:56:39 +00:00
|
|
|
* Copyright (c) 2005-2008 Brenden Matthews, Philip Kovacs, et. al.
|
2008-02-20 20:30:45 +00:00
|
|
|
* (see AUTHORS)
|
2007-08-10 19:53:44 +00:00
|
|
|
* 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
|
2008-02-20 20:30:45 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2005-08-05 01:06:17 +00:00
|
|
|
*
|
2008-03-18 00:23:16 +00:00
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
2005-08-05 01:06:17 +00:00
|
|
|
|
2005-07-20 00:30:40 +00:00
|
|
|
#ifndef _conky_h_
|
|
|
|
#define _conky_h_
|
|
|
|
|
2005-08-23 06:10:25 +00:00
|
|
|
#if defined(HAS_MCHECK_H)
|
2005-08-12 04:34:06 +00:00
|
|
|
#include <mcheck.h>
|
2005-08-23 06:10:25 +00:00
|
|
|
#endif /* HAS_MCHECK_H */
|
2008-02-20 20:30:45 +00:00
|
|
|
|
2008-06-25 21:06:54 +00:00
|
|
|
#undef EQUAL
|
|
|
|
#undef FALSE
|
|
|
|
#undef TRUE
|
2008-06-21 20:37:58 +00:00
|
|
|
#define EQUAL 0 //returnvalue of strcmp-variants when strings are equal
|
2008-06-25 21:06:54 +00:00
|
|
|
#define FALSE 0
|
|
|
|
#define TRUE 1
|
2008-06-21 20:37:58 +00:00
|
|
|
|
2005-07-20 00:30:40 +00:00
|
|
|
#include "config.h"
|
|
|
|
#include <sys/utsname.h>
|
2008-09-11 15:44:48 +00:00
|
|
|
#include <stdio.h>
|
2005-07-20 00:30:40 +00:00
|
|
|
#include <stdlib.h>
|
2006-11-12 06:38:21 +00:00
|
|
|
#include <string.h>
|
2005-07-24 23:08:51 +00:00
|
|
|
#include <locale.h>
|
|
|
|
#include <langinfo.h>
|
|
|
|
#include <wchar.h>
|
2005-10-16 11:53:36 +00:00
|
|
|
#include <sys/param.h>
|
2008-02-20 20:30:45 +00:00
|
|
|
|
2008-03-29 11:35:02 +00:00
|
|
|
#if !defined(__GNUC__)
|
|
|
|
# define __attribute__(x) /* nothing */
|
|
|
|
#endif
|
|
|
|
|
2007-12-31 00:00:35 +00:00
|
|
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
2008-06-14 18:41:12 +00:00
|
|
|
#include "freebsd.h"
|
2008-07-06 09:25:28 +00:00
|
|
|
#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
|
2005-08-30 04:19:16 +00:00
|
|
|
|
2007-03-01 01:43:43 +00:00
|
|
|
#if defined(__OpenBSD__)
|
2008-06-14 18:41:12 +00:00
|
|
|
#include "openbsd.h"
|
2007-03-01 01:43:43 +00:00
|
|
|
#endif /* __OpenBSD__ */
|
|
|
|
|
2008-04-02 19:46:09 +00:00
|
|
|
#ifndef HAVE_STRNDUP
|
|
|
|
// use our own strndup() if it's not available
|
|
|
|
char *strndup(const char *s, size_t n);
|
|
|
|
#endif /* HAVE_STRNDUP */
|
|
|
|
|
2006-11-03 20:54:52 +00:00
|
|
|
#ifdef AUDACIOUS
|
|
|
|
#include "audacious.h"
|
|
|
|
#endif
|
|
|
|
|
2006-03-25 21:21:07 +00:00
|
|
|
#ifdef XMMS2
|
|
|
|
#include <xmmsclient/xmmsclient.h>
|
|
|
|
#endif
|
|
|
|
|
2007-05-06 12:17:13 +00:00
|
|
|
#ifdef RSS
|
2008-06-14 18:41:12 +00:00
|
|
|
#include "rss.h"
|
2007-05-06 12:17:13 +00:00
|
|
|
#endif
|
|
|
|
|
2008-06-28 20:14:04 +00:00
|
|
|
#ifdef EVE
|
|
|
|
#include "eve.h"
|
|
|
|
#endif
|
|
|
|
|
2008-03-18 00:23:16 +00:00
|
|
|
#ifdef SMAPI
|
|
|
|
#include "smapi.h"
|
|
|
|
#endif
|
|
|
|
|
2008-06-03 20:46:15 +00:00
|
|
|
#ifdef NVIDIA
|
|
|
|
#include "nvidia.h"
|
|
|
|
#endif
|
2008-06-15 18:38:33 +00:00
|
|
|
|
2007-02-14 19:45:18 +00:00
|
|
|
#include "mboxscan.h"
|
2006-11-15 01:20:49 +00:00
|
|
|
#include "timed_thread.h"
|
2008-06-14 18:41:12 +00:00
|
|
|
#include "top.h"
|
2005-07-20 00:30:40 +00:00
|
|
|
|
2008-04-01 21:37:49 +00:00
|
|
|
#define DEFAULT_TEXT_BUFFER_SIZE 256
|
2008-03-20 21:28:19 +00:00
|
|
|
extern unsigned int text_buffer_size;
|
2005-07-20 00:30:40 +00:00
|
|
|
|
2006-11-22 21:53:54 +00:00
|
|
|
/* maximum number of special things, e.g. fonts, offsets, aligns, etc. */
|
|
|
|
#define MAX_SPECIALS_DEFAULT 512
|
|
|
|
|
2006-11-09 00:33:46 +00:00
|
|
|
/* maximum size of config TEXT buffer, i.e. below TEXT line. */
|
|
|
|
#define MAX_USER_TEXT_DEFAULT 16384
|
|
|
|
|
2005-07-20 00:30:40 +00:00
|
|
|
#include <sys/socket.h>
|
|
|
|
|
2008-03-29 04:47:10 +00:00
|
|
|
#define ERR(...) { \
|
2008-07-12 10:25:05 +00:00
|
|
|
fprintf(stderr, PACKAGE_NAME": "); \
|
2008-03-29 04:47:10 +00:00
|
|
|
fprintf(stderr, __VA_ARGS__); \
|
|
|
|
fprintf(stderr, "\n"); \
|
|
|
|
}
|
2005-07-20 00:30:40 +00:00
|
|
|
|
|
|
|
/* critical error */
|
2008-03-29 04:47:10 +00:00
|
|
|
#define CRIT_ERR(...) \
|
|
|
|
{ ERR(__VA_ARGS__); exit(EXIT_FAILURE); }
|
2005-07-20 00:30:40 +00:00
|
|
|
|
|
|
|
struct net_stat {
|
|
|
|
const char *dev;
|
|
|
|
int up;
|
|
|
|
long long last_read_recv, last_read_trans;
|
|
|
|
long long recv, trans;
|
|
|
|
double recv_speed, trans_speed;
|
|
|
|
struct sockaddr addr;
|
2008-03-29 04:47:10 +00:00
|
|
|
char* addrs;
|
2005-07-20 00:30:40 +00:00
|
|
|
double net_rec[15], net_trans[15];
|
2007-08-07 12:51:08 +00:00
|
|
|
// wireless extensions
|
|
|
|
char essid[32];
|
|
|
|
char bitrate[16];
|
|
|
|
char mode[16];
|
|
|
|
int link_qual;
|
|
|
|
int link_qual_max;
|
2007-10-17 20:31:27 +00:00
|
|
|
char ap[18];
|
2005-07-20 00:30:40 +00:00
|
|
|
};
|
|
|
|
|
2008-03-22 22:58:26 +00:00
|
|
|
struct dns_data {
|
|
|
|
int nscount;
|
|
|
|
char **ns_list;
|
|
|
|
};
|
|
|
|
|
2005-07-20 00:30:40 +00:00
|
|
|
struct fs_stat {
|
2008-03-19 22:28:23 +00:00
|
|
|
char path[DEFAULT_TEXT_BUFFER_SIZE];
|
|
|
|
char type[DEFAULT_TEXT_BUFFER_SIZE];
|
2005-07-20 00:30:40 +00:00
|
|
|
long long size;
|
|
|
|
long long avail;
|
2005-12-01 06:32:14 +00:00
|
|
|
long long free;
|
2008-03-19 22:28:23 +00:00
|
|
|
char set;
|
2005-07-20 00:30:40 +00:00
|
|
|
};
|
|
|
|
|
2008-02-09 02:21:06 +00:00
|
|
|
#include "diskio.h"
|
|
|
|
|
2006-05-08 22:34:38 +00:00
|
|
|
struct mail_s { // for imap and pop3
|
2006-05-13 19:51:26 +00:00
|
|
|
unsigned long unseen;
|
|
|
|
unsigned long messages;
|
|
|
|
unsigned long used;
|
|
|
|
unsigned long quota;
|
|
|
|
unsigned long port;
|
2008-08-05 18:43:24 +00:00
|
|
|
unsigned int retries;
|
2006-05-08 22:34:38 +00:00
|
|
|
float interval;
|
|
|
|
double last_update;
|
|
|
|
char host[128];
|
|
|
|
char user[128];
|
|
|
|
char pass[128];
|
|
|
|
char command[1024];
|
|
|
|
char folder[128];
|
2006-11-15 01:20:49 +00:00
|
|
|
timed_thread *p_timed_thread;
|
2007-10-17 20:31:27 +00:00
|
|
|
char secure;
|
2008-03-29 09:59:27 +00:00
|
|
|
};
|
2006-05-08 22:34:38 +00:00
|
|
|
|
2008-02-20 20:30:45 +00:00
|
|
|
/* struct cpu_stat {
|
2005-07-20 00:30:40 +00:00
|
|
|
unsigned int user, nice, system, idle, iowait, irq, softirq;
|
|
|
|
int cpu_avg_samples;
|
2008-02-20 20:30:45 +00:00
|
|
|
}; */
|
2005-07-20 00:30:40 +00:00
|
|
|
|
|
|
|
#ifdef MPD
|
2008-06-14 18:41:12 +00:00
|
|
|
#include "mpd.h"
|
2005-07-20 00:30:40 +00:00
|
|
|
#endif
|
|
|
|
|
2006-03-25 21:21:07 +00:00
|
|
|
#ifdef XMMS2
|
2008-06-14 18:41:12 +00:00
|
|
|
#include "xmms2.h"
|
2006-03-25 21:21:07 +00:00
|
|
|
#endif
|
|
|
|
|
2006-11-03 20:54:52 +00:00
|
|
|
#ifdef AUDACIOUS
|
2008-06-16 19:40:28 +00:00
|
|
|
#include "audacious.h"
|
2006-11-03 20:54:52 +00:00
|
|
|
#endif
|
|
|
|
|
2005-12-30 09:44:40 +00:00
|
|
|
#ifdef BMPX
|
2008-06-14 18:41:12 +00:00
|
|
|
#include "bmpx.h"
|
2005-12-30 09:44:40 +00:00
|
|
|
#endif
|
|
|
|
|
2008-03-29 02:01:03 +00:00
|
|
|
void update_entropy(void);
|
2006-11-30 20:46:34 +00:00
|
|
|
struct entropy_s {
|
|
|
|
unsigned int entropy_avail;
|
|
|
|
unsigned int poolsize;
|
|
|
|
};
|
|
|
|
|
2008-03-18 00:23:16 +00:00
|
|
|
struct usr_info {
|
|
|
|
char *names;
|
|
|
|
char *times;
|
|
|
|
char *terms;
|
|
|
|
int number;
|
|
|
|
};
|
|
|
|
|
2008-03-22 19:06:09 +00:00
|
|
|
struct gateway_info {
|
|
|
|
char *iface;
|
|
|
|
char *ip;
|
|
|
|
int count;
|
|
|
|
};
|
|
|
|
|
2008-06-21 20:37:58 +00:00
|
|
|
#ifdef X11
|
|
|
|
struct monitor_info {
|
|
|
|
int number;
|
|
|
|
int current;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct x11_info {
|
|
|
|
struct monitor_info monitor;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2005-10-31 05:17:06 +00:00
|
|
|
#ifdef TCP_PORT_MONITOR
|
|
|
|
#include "libtcp-portmon.h"
|
|
|
|
#endif
|
|
|
|
|
2005-07-20 00:30:40 +00:00
|
|
|
enum {
|
|
|
|
INFO_CPU = 0,
|
|
|
|
INFO_MAIL = 1,
|
|
|
|
INFO_MEM = 2,
|
|
|
|
INFO_NET = 3,
|
2006-11-05 00:23:18 +00:00
|
|
|
INFO_PROCS = 4,
|
|
|
|
INFO_RUN_PROCS = 5,
|
|
|
|
INFO_UPTIME = 6,
|
|
|
|
INFO_BUFFERS = 7,
|
|
|
|
INFO_FS = 8,
|
2007-08-13 23:14:01 +00:00
|
|
|
INFO_SYSFS = 9,
|
2006-11-05 00:23:18 +00:00
|
|
|
INFO_MIXER = 10,
|
|
|
|
INFO_LOADAVG = 11,
|
|
|
|
INFO_UNAME = 12,
|
|
|
|
INFO_FREQ = 13,
|
2005-07-20 00:30:40 +00:00
|
|
|
#ifdef MPD
|
2006-11-05 00:23:18 +00:00
|
|
|
INFO_MPD = 14,
|
2005-07-20 00:30:40 +00:00
|
|
|
#endif
|
2006-11-05 00:23:18 +00:00
|
|
|
INFO_TOP = 15,
|
|
|
|
INFO_WIFI = 16,
|
|
|
|
INFO_DISKIO = 17,
|
|
|
|
INFO_I8K = 18,
|
2005-10-31 05:17:06 +00:00
|
|
|
#ifdef TCP_PORT_MONITOR
|
2008-02-20 20:30:45 +00:00
|
|
|
INFO_TCP_PORT_MONITOR = 19,
|
2005-10-31 05:17:06 +00:00
|
|
|
#endif
|
2006-11-03 20:54:52 +00:00
|
|
|
#ifdef AUDACIOUS
|
2006-11-05 00:23:18 +00:00
|
|
|
INFO_AUDACIOUS = 20,
|
2006-11-03 20:54:52 +00:00
|
|
|
#endif
|
2006-01-08 08:02:37 +00:00
|
|
|
#ifdef BMPX
|
2006-11-05 00:23:18 +00:00
|
|
|
INFO_BMPX = 21,
|
2006-01-07 07:01:22 +00:00
|
|
|
#endif
|
2006-03-25 21:21:07 +00:00
|
|
|
#ifdef XMMS2
|
2006-11-05 00:23:18 +00:00
|
|
|
INFO_XMMS2 = 22,
|
2006-03-25 21:21:07 +00:00
|
|
|
#endif
|
2006-11-30 20:46:34 +00:00
|
|
|
INFO_ENTROPY = 23,
|
2007-05-06 12:17:13 +00:00
|
|
|
#ifdef RSS
|
|
|
|
INFO_RSS = 24,
|
|
|
|
#endif
|
2008-03-18 00:23:16 +00:00
|
|
|
#ifdef SMAPI
|
|
|
|
INFO_SMAPI = 25,
|
|
|
|
#endif
|
|
|
|
INFO_USERS = 26,
|
2008-03-22 22:58:26 +00:00
|
|
|
INFO_GW = 27,
|
2008-06-03 20:46:15 +00:00
|
|
|
#ifdef NVIDIA
|
2008-06-21 20:37:58 +00:00
|
|
|
INFO_NVIDIA = 28,
|
2008-06-03 20:46:15 +00:00
|
|
|
#endif
|
2008-06-21 20:37:58 +00:00
|
|
|
#ifdef X11
|
|
|
|
INFO_X11 = 29,
|
|
|
|
#endif
|
|
|
|
INFO_DNS = 30
|
2008-06-03 20:46:15 +00:00
|
|
|
|
2005-07-20 00:30:40 +00:00
|
|
|
};
|
|
|
|
|
2006-12-12 23:21:14 +00:00
|
|
|
/* get_battery_stuff() item selector */
|
|
|
|
enum {
|
|
|
|
BATTERY_STATUS,
|
|
|
|
BATTERY_TIME
|
|
|
|
};
|
|
|
|
|
2008-05-30 11:30:58 +00:00
|
|
|
/* if_up strictness selector */
|
|
|
|
enum {
|
|
|
|
IFUP_UP,
|
|
|
|
IFUP_LINK,
|
|
|
|
IFUP_ADDR
|
|
|
|
} ifup_strictness;
|
|
|
|
|
2006-12-23 06:01:16 +00:00
|
|
|
/* Update interval */
|
|
|
|
double update_interval;
|
|
|
|
|
2005-11-01 06:51:48 +00:00
|
|
|
volatile int g_signal_pending;
|
|
|
|
|
2005-07-20 00:30:40 +00:00
|
|
|
struct information {
|
|
|
|
unsigned int mask;
|
|
|
|
|
|
|
|
struct utsname uname_s;
|
|
|
|
|
|
|
|
char freq[10];
|
|
|
|
|
|
|
|
double uptime;
|
|
|
|
|
|
|
|
/* memory information in kilobytes */
|
2008-06-21 20:37:58 +00:00
|
|
|
unsigned long long mem, memeasyfree, memfree, memmax, swap, swapmax;
|
2006-11-15 03:28:37 +00:00
|
|
|
unsigned long long bufmem, buffers, cached;
|
2005-07-20 00:30:40 +00:00
|
|
|
|
2005-11-27 06:56:35 +00:00
|
|
|
unsigned short procs;
|
|
|
|
unsigned short run_procs;
|
2005-07-20 00:30:40 +00:00
|
|
|
|
2005-08-27 09:29:24 +00:00
|
|
|
float *cpu_usage;
|
2008-02-20 20:30:45 +00:00
|
|
|
/* struct cpu_stat cpu_summed; what the hell is this? */
|
2005-07-20 00:30:40 +00:00
|
|
|
unsigned int cpu_count;
|
|
|
|
unsigned int cpu_avg_samples;
|
|
|
|
|
|
|
|
unsigned int net_avg_samples;
|
|
|
|
|
|
|
|
float loadavg[3];
|
|
|
|
|
2008-02-20 20:30:45 +00:00
|
|
|
struct mail_s *mail;
|
2006-05-08 22:34:38 +00:00
|
|
|
int mail_running;
|
2005-07-20 00:30:40 +00:00
|
|
|
#ifdef MPD
|
|
|
|
struct mpd_s mpd;
|
2005-12-30 09:44:40 +00:00
|
|
|
#endif
|
2006-03-25 21:21:07 +00:00
|
|
|
#ifdef XMMS2
|
|
|
|
struct xmms2_s xmms2;
|
|
|
|
int xmms2_conn_state;
|
2008-02-20 20:30:45 +00:00
|
|
|
xmms_socket_t xmms2_fd;
|
2006-03-25 21:21:07 +00:00
|
|
|
fd_set xmms2_fdset;
|
|
|
|
xmmsc_connection_t *xmms2_conn;
|
|
|
|
#endif
|
2006-11-03 20:54:52 +00:00
|
|
|
#ifdef AUDACIOUS
|
2008-06-16 19:40:28 +00:00
|
|
|
AUDACIOUS_S audacious;
|
2006-11-03 20:54:52 +00:00
|
|
|
#endif
|
2005-12-30 09:44:40 +00:00
|
|
|
#ifdef BMPX
|
|
|
|
struct bmpx_s bmpx;
|
2005-07-20 00:30:40 +00:00
|
|
|
#endif
|
2008-03-18 00:23:16 +00:00
|
|
|
struct usr_info users;
|
2008-03-22 19:06:09 +00:00
|
|
|
struct gateway_info gw_info;
|
2008-03-22 22:58:26 +00:00
|
|
|
struct dns_data nameserver_info;
|
2005-07-25 00:22:16 +00:00
|
|
|
struct process *cpu[10];
|
|
|
|
struct process *memu[10];
|
2005-11-10 04:19:43 +00:00
|
|
|
struct process *first_process;
|
2005-07-20 00:30:40 +00:00
|
|
|
unsigned long looped;
|
2005-10-31 05:17:06 +00:00
|
|
|
#ifdef TCP_PORT_MONITOR
|
2008-02-20 20:30:45 +00:00
|
|
|
tcp_port_monitor_collection_t *p_tcp_port_monitor_collection;
|
2005-10-31 05:17:06 +00:00
|
|
|
#endif
|
2006-11-30 20:46:34 +00:00
|
|
|
struct entropy_s entropy;
|
2008-02-20 20:30:45 +00:00
|
|
|
double music_player_interval;
|
2007-10-17 20:31:27 +00:00
|
|
|
|
2008-06-21 20:37:58 +00:00
|
|
|
#ifdef X11
|
|
|
|
struct x11_info x11;
|
|
|
|
#endif
|
|
|
|
|
2008-02-20 20:30:45 +00:00
|
|
|
short kflags; /* kernel settings, see enum KFLAG */
|
2008-06-19 19:58:07 +00:00
|
|
|
|
|
|
|
unsigned int diskio_value;
|
|
|
|
unsigned int diskio_read_value;
|
|
|
|
unsigned int diskio_write_value;
|
2005-07-20 00:30:40 +00:00
|
|
|
};
|
|
|
|
|
2005-11-27 06:56:35 +00:00
|
|
|
enum {
|
2008-02-20 20:30:45 +00:00
|
|
|
/* set to true if kernel uses "long" format for /proc/stats */
|
|
|
|
KFLAG_IS_LONGSTAT = 0x01,
|
|
|
|
/* set to true if kernel shows # of threads for the proc value
|
|
|
|
* in sysinfo() call */
|
|
|
|
KFLAG_PROC_IS_THREADS = 0x02
|
|
|
|
/* bits 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 available for future use */
|
|
|
|
/* KFLAG_NEXT_ONE = 0x04 */
|
|
|
|
};
|
2005-11-27 06:56:35 +00:00
|
|
|
|
2008-02-20 20:30:45 +00:00
|
|
|
#define KFLAG_SETON(a) info.kflags |= a
|
2005-11-27 06:56:35 +00:00
|
|
|
#define KFLAG_SETOFF(a) info.kflags &= (~a)
|
|
|
|
#define KFLAG_FLIP(a) info.kflags ^= a
|
|
|
|
#define KFLAG_ISSET(a) info.kflags & a
|
|
|
|
|
2008-06-21 20:37:58 +00:00
|
|
|
#define TO_X 1
|
|
|
|
#define TO_STDOUT 2
|
|
|
|
int output_methods;
|
2005-08-08 01:18:52 +00:00
|
|
|
|
|
|
|
int top_cpu;
|
|
|
|
int top_mem;
|
|
|
|
|
|
|
|
int use_spacer;
|
|
|
|
|
2008-02-09 02:21:06 +00:00
|
|
|
enum spacer_opts { NO_SPACER = 0, LEFT_SPACER, RIGHT_SPACER };
|
|
|
|
|
2008-03-19 22:28:23 +00:00
|
|
|
char *tmpstring1;
|
|
|
|
char *tmpstring2;
|
2005-08-02 05:06:53 +00:00
|
|
|
|
2005-08-08 01:18:52 +00:00
|
|
|
#ifdef X11
|
2008-06-14 18:41:12 +00:00
|
|
|
#include "x11.h"
|
2005-08-08 01:18:52 +00:00
|
|
|
#endif /* X11 */
|
|
|
|
|
2008-01-06 01:35:14 +00:00
|
|
|
int cpu_separate;
|
2008-02-09 02:21:06 +00:00
|
|
|
int short_units;
|
2008-01-06 01:35:14 +00:00
|
|
|
|
2005-07-20 00:30:40 +00:00
|
|
|
/* struct that has all info */
|
|
|
|
struct information info;
|
|
|
|
|
2005-11-01 06:51:48 +00:00
|
|
|
void signal_handler(int);
|
|
|
|
void reload_config(void);
|
|
|
|
void clean_up(void);
|
|
|
|
|
2008-03-29 02:01:03 +00:00
|
|
|
void update_uname(void);
|
2005-07-20 00:30:40 +00:00
|
|
|
double get_time(void);
|
|
|
|
FILE *open_file(const char *file, int *reported);
|
|
|
|
void variable_substitute(const char *s, char *dest, unsigned int n);
|
|
|
|
void format_seconds(char *buf, unsigned int n, long t);
|
|
|
|
void format_seconds_short(char *buf, unsigned int n, long t);
|
|
|
|
struct net_stat *get_net_stat(const char *dev);
|
2006-12-23 06:01:16 +00:00
|
|
|
void clear_net_stats(void);
|
2008-03-22 22:58:26 +00:00
|
|
|
void free_dns_data(void);
|
|
|
|
void update_dns_data(void);
|
2008-03-29 02:01:03 +00:00
|
|
|
void update_users(void);
|
2005-07-20 00:30:40 +00:00
|
|
|
|
2008-06-21 20:37:58 +00:00
|
|
|
#ifdef X11
|
|
|
|
void update_x11info(void);
|
|
|
|
#endif
|
|
|
|
|
2008-03-29 02:01:03 +00:00
|
|
|
void update_stuff(void);
|
2005-07-20 00:30:40 +00:00
|
|
|
|
2005-08-30 14:59:37 +00:00
|
|
|
int round_to_int(float f);
|
|
|
|
|
2005-07-30 11:23:26 +00:00
|
|
|
extern unsigned long long need_mask;
|
2005-07-20 00:30:40 +00:00
|
|
|
|
|
|
|
extern double current_update_time, last_update_time;
|
|
|
|
|
|
|
|
extern int no_buffers;
|
|
|
|
|
2008-06-14 18:41:12 +00:00
|
|
|
#if defined(__linux__)
|
|
|
|
#include "linux.h"
|
2006-03-22 19:27:31 +00:00
|
|
|
#endif
|
|
|
|
|
2008-06-14 18:41:12 +00:00
|
|
|
#include "fs.h"
|
|
|
|
#include "mixer.h"
|
|
|
|
#include "mail.h"
|
|
|
|
|
2008-02-20 20:30:45 +00:00
|
|
|
#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
|
|
|
|
|| defined(__OpenBSD__)) && (defined(i386) || defined(__i386__))
|
2007-05-06 12:13:38 +00:00
|
|
|
int apm_getinfo(int fd, apm_info_t aip);
|
2005-08-30 04:19:16 +00:00
|
|
|
char *get_apm_adapter(void);
|
|
|
|
char *get_apm_battery_life(void);
|
|
|
|
char *get_apm_battery_time(void);
|
|
|
|
#endif
|
2005-07-20 00:30:40 +00:00
|
|
|
|
2006-08-10 16:56:13 +00:00
|
|
|
#ifdef HDDTEMP
|
2008-06-14 18:41:12 +00:00
|
|
|
#include "hddtemp.h"
|
2006-08-10 16:56:13 +00:00
|
|
|
#endif /* HDDTEMP */
|
|
|
|
|
2005-07-20 00:30:40 +00:00
|
|
|
#endif
|