mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-02-04 13:08:31 +00:00
more fixes to new smp stuff, mainly in config parsing
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@213 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
e93155d26b
commit
52b2d75fad
96
README
96
README
@ -11,9 +11,9 @@ SYNOPSIS
|
|||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
Conky is a system monitor for X originally based on the torsmo code.
|
Conky is a system monitor for X originally based on the torsmo code.
|
||||||
Since its original conception, Conky has changed a fair bit from its
|
Since it's original conception, Conky has changed a fair bit from it's
|
||||||
predecessor. Conky can display just about anything, either on your
|
predecessor. Conky can display just about anything, either on your
|
||||||
root desktop or in its own window. Conky has many built-in objects,
|
root desktop or in it's own window. Conky has many built-in objects,
|
||||||
as well as the ability to execute programs and scripts, then display
|
as well as the ability to execute programs and scripts, then display
|
||||||
the output from stdout.
|
the output from stdout.
|
||||||
|
|
||||||
@ -26,9 +26,9 @@ DESCRIPTION
|
|||||||
COMPILING
|
COMPILING
|
||||||
First, make sure you have the X development libraries installed, this
|
First, make sure you have the X development libraries installed, this
|
||||||
should be a package along the lines of "libx11-dev or xorg-x11-dev".
|
should be a package along the lines of "libx11-dev or xorg-x11-dev".
|
||||||
Gentoo users, Conky is in Gentoos Portage. Simply use "emerge conky"
|
Gentoo users, Conky is in Gentoo's Portage. Simply use "emerge conky"
|
||||||
for installation. There is also usually an up-to-date ebuild within
|
for installation. There is also usually an up-to-date ebuild within
|
||||||
Conkys package or in CVS.
|
Conky's package or in CVS.
|
||||||
|
|
||||||
To compile and run Conky with all optional components:
|
To compile and run Conky with all optional components:
|
||||||
|
|
||||||
@ -45,14 +45,14 @@ COMPILING
|
|||||||
|
|
||||||
./conky
|
./conky
|
||||||
|
|
||||||
Conky doesnt probably compile with other compilers than gcc and icc.
|
Conky doesn't probably compile with other compilers than gcc and icc.
|
||||||
It doesnt compile with C89 compiler and not even with pure C99. It
|
It doesn't compile with C89 compiler and not even with pure C99. It
|
||||||
uses few things that might not exist: strdup(), strcasecmp(), strn
|
uses few things that might not exist: strdup(), strcasecmp(), strn-
|
||||||
casecmp(), optarg variable with getopt() and long long (not in C89).
|
casecmp(), optarg variable with getopt() and long long (not in C89).
|
||||||
Crashes in file system statistics stuff when compiled with icc, I dont
|
Crashes in file system statistics stuff when compiled with icc, I don't
|
||||||
know exactly why.
|
know exactly why.
|
||||||
|
|
||||||
You can disable drawing to own window feature in case you dont need
|
You can disable 'drawing to own window' feature in case you don't need
|
||||||
it by passing --disable-own-window to configure -script.
|
it by passing --disable-own-window to configure -script.
|
||||||
|
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ OPTIONS
|
|||||||
|
|
||||||
|
|
||||||
-t TEXT
|
-t TEXT
|
||||||
Text to render, remember single quotes, like -t $uptime
|
Text to render, remember single quotes, like -t ' $uptime '
|
||||||
|
|
||||||
|
|
||||||
-u SECONDS
|
-u SECONDS
|
||||||
@ -123,7 +123,7 @@ CONFIGURATION SETTINGS
|
|||||||
it to $HOME/.conkyrc and then start modifying it.
|
it to $HOME/.conkyrc and then start modifying it.
|
||||||
|
|
||||||
alignment
|
alignment
|
||||||
Aligned position on screen, may be top_left, top_right, bot
|
Aligned position on screen, may be top_left, top_right, bot-
|
||||||
tom_left, bottom_right, or none
|
tom_left, bottom_right, or none
|
||||||
|
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ CONFIGURATION SETTINGS
|
|||||||
|
|
||||||
|
|
||||||
default_shade_color
|
default_shade_color
|
||||||
Default shading color and borders shading color
|
Default shading color and border's shading color
|
||||||
|
|
||||||
|
|
||||||
default_outline_color
|
default_outline_color
|
||||||
@ -161,8 +161,8 @@ CONFIGURATION SETTINGS
|
|||||||
|
|
||||||
|
|
||||||
double_buffer
|
double_buffer
|
||||||
Use the Xdbe extension? (eliminates flicker) It is highly recom
|
Use the Xdbe extension? (eliminates flicker) It is highly recom-
|
||||||
mended to use own window with this one so double buffer wont be
|
mended to use own window with this one so double buffer won't be
|
||||||
so big.
|
so big.
|
||||||
|
|
||||||
|
|
||||||
@ -292,9 +292,9 @@ CONFIGURATION SETTINGS
|
|||||||
VARIABLES
|
VARIABLES
|
||||||
Colors are parsed using XParsecolor(), there might be a list of them:
|
Colors are parsed using XParsecolor(), there might be a list of them:
|
||||||
/usr/X11R6/lib/X11/rgb.txt. Also, http://sedition.com/perl/rgb.html
|
/usr/X11R6/lib/X11/rgb.txt. Also, http://sedition.com/perl/rgb.html
|
||||||
Color can be also in #rrggbb format (hex). Note that when displaying
|
[http://sedition.com/perl/rgb.html] Color can be also in #rrggbb format
|
||||||
bytes, power is 1024 and not 1000 so 1M really means 1024*1024 bytes
|
(hex). Note that when displaying bytes, power is 1024 and not 1000 so
|
||||||
and not 1000*1000.
|
1M really means 1024*1024 bytes and not 1000*1000.
|
||||||
|
|
||||||
addr (interface)
|
addr (interface)
|
||||||
IP address for an interface
|
IP address for an interface
|
||||||
@ -348,15 +348,20 @@ VARIABLES
|
|||||||
Change drawing color to color
|
Change drawing color to color
|
||||||
|
|
||||||
|
|
||||||
cpu CPU usage in percents
|
cpu (cpuN)
|
||||||
|
CPU usage in percents. For SMP machines, the CPU number can be
|
||||||
|
provided as an argument. cpu0 is the total usage, and >=cpu1 are
|
||||||
|
individual CPUs. See $cpu for more info on SMP.
|
||||||
|
|
||||||
|
|
||||||
cpubar (height),(width)
|
cpubar (cpu number) (height),(width)
|
||||||
Bar that shows CPU usage, height is bars height in pixels
|
Bar that shows CPU usage, height is bar's height in pixels
|
||||||
|
|
||||||
|
|
||||||
cpugraph (height),(width) (gradient colour 1) (gradient colour 2)
|
cpugraph (cpu number) (height),(width) (gradient colour 1) (gradient
|
||||||
CPU usage graph, with optional colours in hex, minus the #.
|
colour 2)
|
||||||
|
CPU usage graph, with optional colours in hex, minus the #. See
|
||||||
|
$cpu for more info on SMP.
|
||||||
|
|
||||||
|
|
||||||
diskio Displays current disk IO.
|
diskio Displays current disk IO.
|
||||||
@ -386,8 +391,8 @@ VARIABLES
|
|||||||
|
|
||||||
|
|
||||||
exec command
|
exec command
|
||||||
Executes a shell command and displays the output in conky. warn
|
Executes a shell command and displays the output in conky. warn-
|
||||||
ing: this takes a lot more resources than other variables. Id
|
ing: this takes a lot more resources than other variables. I'd
|
||||||
recommend coding wanted behaviour in C and posting a patch.
|
recommend coding wanted behaviour in C and posting a patch.
|
||||||
|
|
||||||
|
|
||||||
@ -402,7 +407,7 @@ VARIABLES
|
|||||||
|
|
||||||
|
|
||||||
execi interval command
|
execi interval command
|
||||||
Same as exec but with specific interval. Interval cant be less
|
Same as exec but with specific interval. Interval can't be less
|
||||||
than update_interval in configuration.
|
than update_interval in configuration.
|
||||||
|
|
||||||
|
|
||||||
@ -459,7 +464,7 @@ VARIABLES
|
|||||||
|
|
||||||
head logfile lines (interval)
|
head logfile lines (interval)
|
||||||
Displays first N lines of supplied text text file. If interval
|
Displays first N lines of supplied text text file. If interval
|
||||||
is not supplied, Conky assumes 2x Conkys interval. Max of 30
|
is not supplied, Conky assumes 2x Conky's interval. Max of 30
|
||||||
lines can be displayed, or until the text buffer is filled.
|
lines can be displayed, or until the text buffer is filled.
|
||||||
|
|
||||||
|
|
||||||
@ -504,21 +509,21 @@ VARIABLES
|
|||||||
|
|
||||||
i8k_left_fan_rpm
|
i8k_left_fan_rpm
|
||||||
If running the i8k kernel driver for Inspiron laptops, displays
|
If running the i8k kernel driver for Inspiron laptops, displays
|
||||||
the left fans rate of rotation, in revolutions per minute as
|
the left fan's rate of rotation, in revolutions per minute as
|
||||||
listed in /proc/i8k. Beware, some laptops i8k reports these fans
|
listed in /proc/i8k. Beware, some laptops i8k reports these fans
|
||||||
in reverse order.
|
in reverse order.
|
||||||
|
|
||||||
|
|
||||||
i8k_left_fan_status
|
i8k_left_fan_status
|
||||||
If running the i8k kernel driver for Inspiron laptops, displays
|
If running the i8k kernel driver for Inspiron laptops, displays
|
||||||
the left fan status as listed in /proc/i8k (translated to
|
the left fan status as listed in /proc/i8k (translated to human-
|
||||||
human-readable). Beware, some laptops i8k reports these fans in
|
readable). Beware, some laptops i8k reports these fans in
|
||||||
reverse order.
|
reverse order.
|
||||||
|
|
||||||
|
|
||||||
i8k_right_fan_rpm
|
i8k_right_fan_rpm
|
||||||
If running the i8k kernel driver for Inspiron laptops, displays
|
If running the i8k kernel driver for Inspiron laptops, displays
|
||||||
the right fans rate of rotation, in revolutions per minute as
|
the right fan's rate of rotation, in revolutions per minute as
|
||||||
listed in /proc/i8k. Beware, some laptops i8k reports these fans
|
listed in /proc/i8k. Beware, some laptops i8k reports these fans
|
||||||
in reverse order.
|
in reverse order.
|
||||||
|
|
||||||
@ -639,7 +644,7 @@ VARIABLES
|
|||||||
|
|
||||||
|
|
||||||
mpd_bar (height),(width)
|
mpd_bar (height),(width)
|
||||||
Bar of mpds progress
|
Bar of mpd's progress
|
||||||
|
|
||||||
|
|
||||||
mpd_bitrate
|
mpd_bitrate
|
||||||
@ -655,19 +660,19 @@ VARIABLES
|
|||||||
|
|
||||||
|
|
||||||
mpd_vol
|
mpd_vol
|
||||||
MPDs volume
|
MPD's volume
|
||||||
|
|
||||||
|
|
||||||
mpd_elapsed
|
mpd_elapsed
|
||||||
Songs elapsed time
|
Song's elapsed time
|
||||||
|
|
||||||
|
|
||||||
mpd_length
|
mpd_length
|
||||||
Songs length
|
Song's length
|
||||||
|
|
||||||
|
|
||||||
mpd_percent
|
mpd_percent
|
||||||
Percent of songs progress
|
Percent of song's progress
|
||||||
|
|
||||||
|
|
||||||
new_mails
|
new_mails
|
||||||
@ -728,18 +733,18 @@ VARIABLES
|
|||||||
|
|
||||||
tail logfile lines (interval)
|
tail logfile lines (interval)
|
||||||
Displays last N lines of supplied text text file. If interval is
|
Displays last N lines of supplied text text file. If interval is
|
||||||
not supplied, Conky assumes 2x Conkys interval. Max of 30 lines
|
not supplied, Conky assumes 2x Conky's interval. Max of 30 lines
|
||||||
can be displayed, or until the text buffer is filled.
|
can be displayed, or until the text buffer is filled.
|
||||||
|
|
||||||
|
|
||||||
time (format)
|
time (format)
|
||||||
Local time, see man strftime to get more information about for
|
Local time, see man strftime to get more information about for-
|
||||||
mat
|
mat
|
||||||
|
|
||||||
|
|
||||||
totaldown net
|
totaldown net
|
||||||
Total download, overflows at 4 GB on Linux with 32-bit arch and
|
Total download, overflows at 4 GB on Linux with 32-bit arch and
|
||||||
there doesnt seem to be a way to know how many times it has
|
there doesn't seem to be a way to know how many times it has
|
||||||
already done that before conky has started.
|
already done that before conky has started.
|
||||||
|
|
||||||
|
|
||||||
@ -802,7 +807,7 @@ VARIABLES
|
|||||||
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
conky -t${time %D %H:%m}-o -u 30
|
conky -t '${time %D %H:%m}' -o -u 30
|
||||||
Start Conky in its own window with date and clock as text and 30
|
Start Conky in its own window with date and clock as text and 30
|
||||||
sec update interval.
|
sec update interval.
|
||||||
|
|
||||||
@ -813,9 +818,9 @@ FILES
|
|||||||
~/.conkyrc default configuration file
|
~/.conkyrc default configuration file
|
||||||
|
|
||||||
BUGS
|
BUGS
|
||||||
Drawing to root or some other desktop window directly doesnt work with
|
Drawing to root or some other desktop window directly doesn't work with
|
||||||
all window managers. Especially doesnt work well with Gnome and it has
|
all window managers. Especially doesn't work well with Gnome and it has
|
||||||
been reported that it doesnt work with KDE either. Nautilus can be
|
been reported that it doesn't work with KDE either. Nautilus can be
|
||||||
disabled from drawing to desktop with program gconf-editor. Uncheck
|
disabled from drawing to desktop with program gconf-editor. Uncheck
|
||||||
show_desktop in /apps/nautilus/preferences/. There is -w switch in
|
show_desktop in /apps/nautilus/preferences/. There is -w switch in
|
||||||
Conky to set some specific window id. You might find xwininfo -tree
|
Conky to set some specific window id. You might find xwininfo -tree
|
||||||
@ -823,14 +828,15 @@ BUGS
|
|||||||
which makes Conky to create its own window.
|
which makes Conky to create its own window.
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
http://conky.sourceforge.net
|
http://conky.sourceforge.net [http://conky.sourceforge.net]
|
||||||
|
|
||||||
http://www.sourceforge.net/projects/conky
|
http://www.sourceforge.net/projects/conky [http://www.source-
|
||||||
|
forge.net/projects/conky]
|
||||||
|
|
||||||
#conky on irc.freenode.net
|
#conky on irc.freenode.net
|
||||||
|
|
||||||
AUTHORS
|
AUTHORS
|
||||||
The Conky dev team. Whats up now??!
|
The Conky dev team. What's up now??!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -124,10 +124,10 @@
|
|||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<command><option>cpu</option></command>
|
<command><option>cpu</option></command>
|
||||||
<option>(cpu number)</option>
|
<option>(cpuN)</option>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
CPU usage in percents. For SMP machines, the CPU number can be provided as an argument. 0 is the total usage, and >=1 are individual CPUs. See $cpu for more info on SMP.
|
CPU usage in percents. For SMP machines, the CPU number can be provided as an argument. cpu0 is the total usage, and >=cpu1 are individual CPUs. See $cpu for more info on SMP.
|
||||||
<para></para></listitem>
|
<para></para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
33
src/conky.c
33
src/conky.c
@ -1039,38 +1039,31 @@ if (s[0] == '#') {
|
|||||||
END OBJ(cached, INFO_BUFFERS)
|
END OBJ(cached, INFO_BUFFERS)
|
||||||
END OBJ(cpu, INFO_CPU)
|
END OBJ(cpu, INFO_CPU)
|
||||||
if (arg) {
|
if (arg) {
|
||||||
if (sscanf(arg, "%i", &obj->data.cpu_index) < 1) {
|
if (strncmp(arg, "cpu", 3) == 0 && isdigit(arg[3])) {
|
||||||
ERR("$cpu takes an int as an arg");
|
obj->data.cpu_index = atoi(&arg[3]);
|
||||||
}
|
arg += 4;
|
||||||
|
} else {obj->data.cpu_index = 0; }
|
||||||
} else {
|
} else {
|
||||||
obj->data.cpu_index = 0;
|
obj->data.cpu_index = 0;
|
||||||
}
|
}
|
||||||
END OBJ(cpubar, INFO_CPU)
|
END OBJ(cpubar, INFO_CPU)
|
||||||
if (arg) {
|
if (arg) {
|
||||||
if (sscanf(arg, "%i", &obj->data.cpu_index) < 1) {
|
if (strncmp(arg, "cpu", 3) == 0 && isdigit(arg[3])) {
|
||||||
if (sscanf(arg, "%i %*s", &obj->data.cpu_index) < 1) {
|
obj->data.cpu_index = atoi(&arg[3]);
|
||||||
ERR("$cpu takes an int as an arg");
|
arg += 4;
|
||||||
} else {
|
|
||||||
char buf[128];
|
|
||||||
sscanf(arg, "%*i %127s", buf);
|
|
||||||
(void) scan_bar(buf, &obj->a, &obj->b);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
(void) scan_bar(arg, &obj->a, &obj->b);
|
||||||
} else {
|
} else {
|
||||||
obj->data.cpu_index = 0;
|
obj->data.cpu_index = 0;
|
||||||
}
|
}
|
||||||
END OBJ(cpugraph, INFO_CPU)
|
END OBJ(cpugraph, INFO_CPU)
|
||||||
if (arg) {
|
if (arg) {
|
||||||
if (sscanf(arg, "%i", &obj->data.cpu_index) < 1) {
|
if (strncmp(arg, "cpu", 3) == 0 && isdigit(arg[3])) {
|
||||||
if (sscanf(arg, "%i %*s", &obj->data.cpu_index) < 1) {
|
obj->data.cpu_index = atoi(&arg[3]);
|
||||||
ERR("$cpu takes an int as an arg");
|
arg += 4;
|
||||||
} else {
|
|
||||||
char buf[128];
|
|
||||||
sscanf(arg, "%*i %127s", buf);
|
|
||||||
(void) scan_graph(buf, &obj->a, &obj->b, &obj->c, &obj->d, &obj->e);
|
|
||||||
}
|
}
|
||||||
}
|
(void) scan_graph(arg, &obj->a, &obj->b, &obj->c, &obj->d, &obj->e);
|
||||||
} else {
|
} else {
|
||||||
obj->data.cpu_index = 0;
|
obj->data.cpu_index = 0;
|
||||||
}
|
}
|
||||||
END OBJ(diskio, INFO_DISKIO)
|
END OBJ(diskio, INFO_DISKIO)
|
||||||
|
@ -415,7 +415,11 @@ inline static void update_stat()
|
|||||||
for (i = 0; i < info.cpu_avg_samples; i++) {
|
for (i = 0; i < info.cpu_avg_samples; i++) {
|
||||||
curtmp += cpu[index].cpu_val[i];
|
curtmp += cpu[index].cpu_val[i];
|
||||||
}
|
}
|
||||||
|
if (index == 0) {
|
||||||
|
info.cpu_usage[index] = curtmp / info.cpu_avg_samples / info.cpu_count;
|
||||||
|
} else {
|
||||||
info.cpu_usage[index] = curtmp / info.cpu_avg_samples;
|
info.cpu_usage[index] = curtmp / info.cpu_avg_samples;
|
||||||
|
}
|
||||||
cpu[index].last_cpu_sum = cpu[index].cpu_user + cpu[index].cpu_nice + cpu[index].cpu_system;
|
cpu[index].last_cpu_sum = cpu[index].cpu_user + cpu[index].cpu_nice + cpu[index].cpu_system;
|
||||||
for (i = info.cpu_avg_samples; i > 1; i--)
|
for (i = info.cpu_avg_samples; i > 1; i--)
|
||||||
cpu[index].cpu_val[i - 1] = cpu[index].cpu_val[i - 2];
|
cpu[index].cpu_val[i - 1] = cpu[index].cpu_val[i - 2];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user