1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-11 10:38:12 +00:00
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@57 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Brenden Matthews 2005-08-05 01:06:17 +00:00
parent aec4c082f3
commit a3106fac72
16 changed files with 150 additions and 42 deletions

View File

@ -9,20 +9,19 @@
<ignoreparts/>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
<description/>
<description></description>
<versioncontrol/>
<secondaryLanguages/>
</general>
<kdevautoproject>
<general>
<activetarget>src/Conky</activetarget>
<activetarget>conky</activetarget>
<useconfiguration>debug</useconfiguration>
</general>
<run>
<mainprogram>conky</mainprogram>
<directoryradio>build</directoryradio>
<customdirectory>/</customdirectory>
<programargs/>
<programargs></programargs>
<terminal>false</terminal>
<autocompile>true</autocompile>
<envvars/>
@ -36,7 +35,7 @@
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevpgf77options</f77compiler>
<cflags>-O2 -pipe</cflags>
<cflags>-fomit-frame-pointer -O2 -fexceptions</cflags>
<envvars/>
<configargs>--prefix=/usr --enable-mpd --enable-xft --enable-seti --enable-double-buffer --enable-own-window --enable-metar --enable-mldonkey</configargs>
<topsourcedir/>
@ -49,21 +48,21 @@
<f77flags/>
</optimized>
<debug>
<configargs>--enable-debug=full --prefix=/usr --enable-xft --enable-double-buffer --enable-own-window --enable-metar --enable-mldonkey</configargs>
<configargs>--enable-debug=full --prefix=/usr --enable-mpd --enable-xft --enable-seti --enable-double-buffer --enable-own-window --enable-metar --enable-mldonkey</configargs>
<builddir>debug</builddir>
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevpgf77options</f77compiler>
<cflags>-O2 -Wall</cflags>
<cflags>-O2 -Wall -fexceptions -fomit-frame-pointer -fshort-enums -g3</cflags>
<envvars/>
<topsourcedir/>
<cppflags/>
<ldflags/>
<ccompilerbinary/>
<cxxcompilerbinary/>
<f77compilerbinary/>
<cxxflags>-O2 -Wall</cxxflags>
<f77flags/>
<topsourcedir></topsourcedir>
<cppflags></cppflags>
<ldflags></ldflags>
<ccompilerbinary></ccompilerbinary>
<cxxcompilerbinary></cxxcompilerbinary>
<f77compilerbinary></f77compilerbinary>
<cxxflags></cxxflags>
<f77flags></f77flags>
</debug>
</configurations>
<make>
@ -80,12 +79,12 @@
</kdevautoproject>
<kdevdebugger>
<general>
<dbgshell>libtool</dbgshell>
<programargs/>
<gdbpath/>
<configGdbScript/>
<runShellScript/>
<runGdbScript/>
<dbgshell>/usr/bin/libtool</dbgshell>
<programargs></programargs>
<gdbpath>/usr/bin/</gdbpath>
<configGdbScript></configGdbScript>
<runShellScript></runShellScript>
<runGdbScript></runGdbScript>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
@ -166,7 +165,7 @@
<headerCompletionDelay>250</headerCompletionDelay>
</codecompletion>
<creategettersetter>
<prefixGet/>
<prefixGet></prefixGet>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>

View File

@ -1,3 +1,11 @@
/*
* Conky, a system monitor, based on torsmo
*
* This program is licensed under BSD license, read COPYING
*
* $Id$
*/
#include "conky.h"
#include <stdio.h>
#include <stdlib.h>

28
conky.c
View File

@ -1,6 +1,9 @@
/* Conky, a system monitor, based on torsmo
/*
* Conky, a system monitor, based on torsmo
*
* This program is licensed under BSD license, read COPYING
*
* $Id$
*/
#include "conky.h"
@ -128,7 +131,7 @@ static void load_fonts()
#ifdef XFT
/* load Xft font */
if (use_xft) {
if (fonts[i].xftfont != NULL && font_count < 1) {
if (fonts[i].xftfont != NULL && selected_font == 0) {
XftFontClose(display, fonts[i].xftfont);
}
if ((fonts[i].xftfont =
@ -3997,20 +4000,21 @@ int main(int argc, char **argv)
{
/* handle command line parameters that don't change configs */
char *s;
char temp[10];
unsigned int x;
if (((s = getenv("LC_ALL")) && *s)
|| ((s = getenv("LC_CTYPE")) && *s) || ((s = getenv("LANG"))
&& *s)) {
if (strstr(s, "UTF-8") || strstr(s, "utf-8")
|| strstr(s, "UTF8")
|| strstr(s, "utf8"))
if (((s = getenv("LC_ALL")) && *s) || ((s = getenv("LC_CTYPE")) &&
*s) || ((s = getenv("LANG")) && *s)) {
strcpy(temp, s);
for(x = 0; x < strlen(s) ; x++) {
temp[x] = tolower(s[x]);
}
if (strstr(temp, "utf-8") || strstr(temp, "utf8")) {
utf8_mode = 1;
}
}
if (!setlocale(LC_CTYPE, "")) {
fprintf
(stderr,
"Can't set the specified locale! "
"Check LANG, LC_CTYPE, LC_ALL.\n");
ERR("Can't set the specified locale!\nCheck LANG, LC_CTYPE, LC_ALL.");
return 1;
}
while (1) {

View File

@ -1,3 +1,11 @@
/*
* Conky, a system monitor, based on torsmo
*
* This program is licensed under BSD license, read COPYING
*
* $Id$
*/
#ifndef _conky_h_
#define _conky_h_

8
fs.c
View File

@ -1,3 +1,11 @@
/*
* Conky, a system monitor, based on torsmo
*
* This program is licensed under BSD license, read COPYING
*
* $Id$
*/
#include "conky.h"
#include <unistd.h>
#include <stdlib.h>

2
ftp.c
View File

@ -3,6 +3,8 @@
* directory availability. No transfer is needed.
*
* Reference: RFC 959
*
* $Id$
*/
#include <sys/types.h>

2
ftp.h
View File

@ -3,6 +3,8 @@
* to check for directory availability. No transfer is needed.
*
* Reference: RFC 959
*
* $Id$
*/
#ifndef __MIRRORS_FTP_H__

View File

@ -28,6 +28,8 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
$Id$
*/

41
linux.c
View File

@ -1,3 +1,10 @@
/* linux.c
* Contains linux specific code
*
* $Id$
*/
#include "conky.h"
#include <stdio.h>
#include <stdlib.h>
@ -636,7 +643,6 @@ char *get_adt746x_cpu()
/***********************************************************************/
/*
* $Id$
* This file is part of x86info.
* (C) 2001 Dave Jones.
*
@ -646,19 +652,21 @@ char *get_adt746x_cpu()
* Small changes by David Sterba <sterd9am@ss1000.ms.mff.cuni.cz>
*
*/
#if defined(CPU_X86)
#if defined(__i386) || defined(__x86_64)
__inline__ unsigned long long int rdtsc()
{
unsigned long long int x;
__asm__ volatile (".byte 0x0f, 0x31":"=A" (x));
return x;
}
#endif
static char *buffer = NULL;
#else
static char *frequency;
#endif
char *get_freq()
{
#if defined(__i386) || defined(__x86_64)
if (buffer == NULL)
buffer = malloc(64);
struct timezone tz;
@ -670,16 +678,12 @@ char *get_freq()
/* get this function in cached memory */
gettimeofday(&tvstart, &tz);
#if defined(CPU_X86)
cycles[0] = rdtsc();
#endif
gettimeofday(&tvstart, &tz);
/* we don't trust that this is any specific length of time */
usleep(100);
#if defined(CPU_X86)
cycles[1] = rdtsc();
#endif
gettimeofday(&tvstop, &tz);
microseconds = ((tvstop.tv_sec - tvstart.tv_sec) * 1000000) +
(tvstop.tv_usec - tvstart.tv_usec);
@ -687,6 +691,27 @@ char *get_freq()
sprintf(buffer, "%lldMHz", (cycles[1] - cycles[0]) / microseconds);
return buffer;
#else
FILE *f;
char s[1000];
if (frequency == NULL) {
frequency = (char *) malloc(100);
assert(frequency != NULL);
}
//char frequency[10];
f = fopen("/proc/cpuinfo", "r"); //open the CPU information file
//if (!f)
// return;
while (fgets(s, 1000, f) != NULL) //read the file
if (strncmp(s, "cpu M", 5) == 0) { //and search for the cpu mhz
//printf("%s", strchr(s, ':')+2);
strcpy(frequency, strchr(s, ':') + 2); //copy just the number
frequency[strlen(frequency) - 1] = '\0'; // strip \n
break;
}
fclose(f);
return frequency;
#endif
}

8
mail.c
View File

@ -1,3 +1,11 @@
/*
* Conky, a system monitor, based on torsmo
*
* This program is licensed under BSD license, read COPYING
*
* $Id$
*/
#include "conky.h"
#include <stdio.h>
#include <string.h>

View File

@ -1,3 +1,11 @@
/*
* Conky, a system monitor, based on torsmo
*
* This program is licensed under BSD license, read COPYING
*
* $Id$
*/
#include "conky.h"
#include <string.h>
#include "ftp.h"

View File

@ -1,3 +1,11 @@
/*
* Conky, a system monitor, based on torsmo
*
* This program is licensed under BSD license, read COPYING
*
* $Id$
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

View File

@ -1,3 +1,11 @@
/*
* Conky, a system monitor, based on torsmo
*
* This program is licensed under BSD license, read COPYING
*
* $Id$
*/
#include "conky.h"
#include <string.h>
#include <stdlib.h>

8
top.c
View File

@ -1,3 +1,11 @@
/*
* Conky, a system monitor, based on torsmo
*
* This program is licensed under BSD license, read COPYING
*
* $Id$
*/
#include "top.h"
static regex_t *exclusion_expression = 0;

2
top.h
View File

@ -11,6 +11,8 @@
* from code originally contained in wmsysmon by Dave Clark
(clarkd@skynet.ca)
* This software is licensed through the GNU General Public License.
* $Id$
*/
/*

8
x11.c
View File

@ -1,3 +1,11 @@
/*
* Conky, a system monitor, based on torsmo
*
* This program is licensed under BSD license, read COPYING
*
* $Id$
*/
#include "conky.h"
#include <X11/Xlib.h>
#include <X11/Xatom.h>