Release 0.1.6
This is the last release with GTK 1.2
0.1.6:
- FreeBSD port
0.1.5:
- updated man page (added new options)
- updated Makefile (removed one INSTALL line)
This commit is contained in:
parent
19b9d73eba
commit
0e3c47829a
6 changed files with 76 additions and 11 deletions
|
|
@ -3,3 +3,5 @@ Gilles Cuesta <gcuesta@netimedias.com>: bug report
|
|||
Olivier Perron <olivier.perron@gadz.org>: debian package
|
||||
Guillaume Rousse <rousse@ccr.jussieu.fr>: rpm package
|
||||
Cyprien Laplace <cyprien33@laposte.net>: new developper
|
||||
Roman Bogorodskiy <bogorodskiy@inbox.ru>: FreeBSD port
|
||||
|
||||
|
|
|
|||
14
ChangeLog
14
ChangeLog
|
|
@ -1,5 +1,17 @@
|
|||
2004-10-20 Roman Bogorodskiy <bogorodskiy@inbox.ru>
|
||||
|
||||
* Makefile: FreeBSD port
|
||||
* hot-babe.c: FreeBSD port: use of sysctl "kern.cp_time"
|
||||
|
||||
|
||||
2004-09-13 Cypou <cyprien33@laposte.net>
|
||||
|
||||
* added new options in man page
|
||||
* updated Makefile
|
||||
|
||||
2004-08-25 Cypou <cyprien33@laposte.net>
|
||||
* loader.c: Used to load images from a directory
|
||||
|
||||
* loader.c: Used to load a set of images from a directory
|
||||
* hot-babe.c: Use of loader.c, added small optimisations, added a -n
|
||||
(--nice) option to automatically nice the hot-babe. Added
|
||||
--dir option to specify another images directory.
|
||||
|
|
|
|||
3
Makefile
3
Makefile
|
|
@ -7,7 +7,7 @@ CFLAGS = -O2 -Wall -g `gtk-config --cflags` `gdk-pixbuf-config --cflags` -DDESTD
|
|||
|
||||
OBJS = hot-babe.o loader.o
|
||||
CC = gcc
|
||||
LIBS = `gtk-config --libs | sed "s/-lgtk//g"` `gdk-pixbuf-config --libs`
|
||||
LIBS = `gtk-config --libs` `gdk-pixbuf-config --libs`
|
||||
INSTALL = -m 755
|
||||
|
||||
all: hot-babe
|
||||
|
|
@ -21,6 +21,5 @@ clean:
|
|||
install:
|
||||
install -d $(DESTDIR)/bin
|
||||
install $(INSTALL) hot-babe $(DESTDIR)/bin
|
||||
install -d $(DESTDIR)/share/hot-babe
|
||||
install -d $(DESTDIR)/share/hot-babe/hb01
|
||||
install $(INSTALL) hb01/* $(DESTDIR)/share/hot-babe/hb01
|
||||
|
|
|
|||
8
NEWS
8
NEWS
|
|
@ -1,7 +1,15 @@
|
|||
0.1.6:
|
||||
- FreeBSD port
|
||||
|
||||
0.1.5:
|
||||
- updated man page (added new options)
|
||||
- updated Makefile (removed one INSTALL line)
|
||||
|
||||
0.1.4:
|
||||
- New option: -n, --nice
|
||||
- New option: --dir
|
||||
- Load images from a directory
|
||||
- Pictures are in a separate directory instead than inlined
|
||||
|
||||
0.1.3:
|
||||
- bugfixes and optimisation release. Nothing new here.
|
||||
|
|
|
|||
31
hot-babe.1
31
hot-babe.1
|
|
@ -2,7 +2,7 @@
|
|||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH HOT-BABE 1 "September 20, 2002"
|
||||
.TH HOT-BABE 1 "August 25, 2004"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
|
|
@ -24,9 +24,6 @@ hot-babe \- is a small graphical utility which display the system activity in a
|
|||
This manual page documents briefly the
|
||||
.B hot-babe
|
||||
command.
|
||||
This manual page was written for the Debian GNU/Linux distribution
|
||||
because the original program does not have a manual page.
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
|
||||
.\" respectively.
|
||||
|
|
@ -48,10 +45,32 @@ ponder every sample with time, the result is a somewhat smoother animation, and
|
|||
.TP
|
||||
.B \-N, \-\-noNice
|
||||
Don't consider reniced processes. This is usefull if you use seti@home or distributed.net, which always eat almost all the CPU.
|
||||
.TP
|
||||
.B \-n, \-\-nice
|
||||
n Put the hot-babe process in nice n.
|
||||
.SH SEE ALSO
|
||||
.TP
|
||||
.B \-\-dir
|
||||
directory give the directory where hot-babe must load the pictures.
|
||||
.SH FILES
|
||||
.TP
|
||||
.B share/hot-babe/hb01/
|
||||
directory of hot-babes pictures.
|
||||
.P
|
||||
.B Note:
|
||||
This directory must contain a file named "descr" which gives some info to the hot-babe process. The first line gives the number of pictures to use, and then the name of the pictures, one per line.
|
||||
.P
|
||||
Here is an example:
|
||||
.RS
|
||||
.ft CW
|
||||
.nf
|
||||
.ne
|
||||
5
|
||||
hb01_4.png
|
||||
hb01_3.png
|
||||
hb01_2.png
|
||||
hb01_1.png
|
||||
hb01_0.png
|
||||
.br
|
||||
.SH AUTHOR
|
||||
This manual page was written for the Debian GNU/Linux system (but may be used by others).
|
||||
This page has been updated by Cyprien <cyprien33@laposte.net>
|
||||
|
||||
|
|
|
|||
29
hot-babe.c
29
hot-babe.c
|
|
@ -26,6 +26,11 @@
|
|||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/resource.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
/* x11 includes */
|
||||
#include <gdk/gdk.h>
|
||||
|
|
@ -69,14 +74,34 @@ HotBabeData bm;
|
|||
static int system_cpu(void)
|
||||
{
|
||||
unsigned int cpuload;
|
||||
int i;
|
||||
#ifdef __linux__
|
||||
u_int64_t load, total, oload, ototal;
|
||||
u_int64_t ab, ac, ad, ae;
|
||||
int i;
|
||||
FILE *stat;
|
||||
#endif
|
||||
#ifdef __FreeBSD__
|
||||
long load, total, oload, ototal;
|
||||
long ab, ac, ad, ae;
|
||||
long cp_time[CPUSTATES];
|
||||
size_t len = sizeof(cp_time);
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
stat = fopen("/proc/stat", "r");
|
||||
fscanf(stat, "%*s %Ld %Ld %Ld %Ld", &ab, &ac, &ad, &ae);
|
||||
fclose(stat);
|
||||
#endif
|
||||
#ifdef __FreeBSD__
|
||||
if (sysctlbyname("kern.cp_time", &cp_time, &len, NULL, 0) < 0)
|
||||
(void)fprintf(stderr, "Cannot get kern.cp_time");
|
||||
|
||||
ab = cp_time[CP_USER];
|
||||
ac = cp_time[CP_NICE];
|
||||
ad = cp_time[CP_SYS];
|
||||
ae = cp_time[CP_IDLE];
|
||||
#endif
|
||||
|
||||
|
||||
/* Find out the CPU load */
|
||||
/* user + sys = load
|
||||
|
|
@ -103,7 +128,7 @@ static int system_cpu(void)
|
|||
cpuload = 0;
|
||||
else
|
||||
cpuload = (256 * (load - oload)) / (total - ototal);
|
||||
|
||||
|
||||
return cpuload;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue