# $Id$
+2006-06-07
+ * Small battery fix (thanks Nexox, sf.net patch 1500014)
+ * Fixed order of variables/objects in docs (thanks Peter Tarjan)
+
2006-05-27
* Fixed a bug with $font
omitted, the parameter defaults to 1.
- voltage_mv (n)
- Returns CPU #n's voltage in mV. CPUs are counted from 1. If
- omitted, the parameter defaults to 1.
-
-
- voltage_v (n)
- Returns CPU #n's voltage in V. CPUs are counted from 1. If omit-
- ted, the parameter defaults to 1.
-
-
freq_dyn
Returns CPU frequency in MHz, but is calculated by counting to
clock cycles to complete an instruction. Only available for
the version formatting of /proc/i8k.
+ ibm_fan
+ If running the IBM ACPI, displays the fan speed.
+
+
+ ibm_temps N
+ If running the IBM ACPI, displays the temperatures from the IBM
+ temperature sensors (N=0..7) Sensor 0 is on the CPU, 3 is on the
+ GPU.
+
+
+ ibm_volume
+ If running the IBM ACPI, displays the "master" volume, con-
+ trolled by the volume keys (0-14).
+
+
+ ibm_brightness
+ If running the IBM ACPI, displays the brigtness of the laptops's
+ LCD (0-7).
+
+
if_running (process)
if PROCESS is running, display everything if_running and the
matching $endif
text to overlap. See also $offset.
+ voltage_mv (n)
+ Returns CPU #n's voltage in mV. CPUs are counted from 1. If
+ omitted, the parameter defaults to 1.
+
+
+ voltage_v (n)
+ Returns CPU #n's voltage in V. CPUs are counted from 1. If omit-
+ ted, the parameter defaults to 1.
+
+
xmms_bar (height),(width)
xmms / bmp / audacious / infopipe: progress bar
xmms / bmp / audacious / infopipe: title of current tune
- ibm_fan
- If running the IBM ACPI, displays the fan speed.
-
-
- ibm_temps N
- If running the IBM ACPI, displays the temperatures from the IBM
- temperature sensors (N=0..7) Sensor 0 is on the CPU, 3 is on the
- GPU.
-
-
- ibm_volume
- If running the IBM ACPI, displays the "master" volume, con-
- trolled by the volume keys (0-14).
-
-
- ibm_brightness
- If running the IBM ACPI, displays the brigtness of the laptops's
- LCD (0-7).
-
-
EXAMPLES
conky -t '${time %D %H:%m}' -o -u 30
Start Conky in its own window with date and clock as text and 30
dnl C Compiler
dnl
-if test x$CFLAGS = x; then
- AC_SUBST(CFLAGS, [ ])
-fi
AC_PROG_CC
AC_PROG_LIBTOOL
PKG_PROG_PKG_CONFIG([0.17.2])
\fBfreq\fR \fB(n)\fR
Returns CPU #n's frequency in MHz. CPUs are
counted from 1. If omitted, the parameter
-defaults to 1.
+defaults to 1.
.TP
\fBfreq_g\fR \fB(n)\fR
defaults to 1.
.TP
-\fBvoltage_mv\fR \fB(n)\fR
-Returns CPU #n's voltage in mV. CPUs are
-counted from 1. If omitted, the parameter
-defaults to 1.
-
-.TP
-\fBvoltage_v\fR \fB(n)\fR
-Returns CPU #n's voltage in V. CPUs are
-counted from 1. If omitted, the parameter
-defaults to 1.
-
-.TP
\fBfreq_dyn\fR
Returns CPU frequency in MHz, but is calculated by counting to clock cycles to complete an instruction. Only available for x86/amd64.
If running the i8k kernel driver for Inspiron laptops, displays the version formatting of /proc/i8k.
.TP
+\fBibm_fan\fR
+If running the IBM ACPI, displays the fan speed.
+
+.TP
+\fBibm_temps\fR \fBN\fR
+If running the IBM ACPI, displays the temperatures
+from the IBM temperature sensors (N=0..7) Sensor 0 is
+on the CPU, 3 is on the GPU.
+
+.TP
+\fBibm_volume\fR
+If running the IBM ACPI, displays the "master" volume,
+controlled by the volume keys (0-14).
+
+.TP
+\fBibm_brightness\fR
+If running the IBM ACPI, displays the brigtness of the
+laptops's LCD (0-7).
+
+.TP
\fBif_running\fR \fB(process)\fR
if PROCESS is running, display everything if_running and the matching $endif
Change vertical offset by N pixels. Negative values will cause text to overlap. See also $offset.
.TP
+\fBvoltage_mv\fR \fB(n)\fR
+Returns CPU #n's voltage in mV. CPUs are
+counted from 1. If omitted, the parameter
+defaults to 1.
+
+.TP
+\fBvoltage_v\fR \fB(n)\fR
+Returns CPU #n's voltage in V. CPUs are
+counted from 1. If omitted, the parameter
+defaults to 1.
+
+.TP
\fBxmms_bar\fR \fB(height),(width)\fR
xmms / bmp / audacious / infopipe: progress bar
\fBxmms_title\fR
xmms / bmp / audacious / infopipe: title of current tune
-.TP
-\fBibm_fan\fR
-If running the IBM ACPI, displays the fan speed.
-
-.TP
-\fBibm_temps\fR \fBN\fR
-If running the IBM ACPI, displays the temperatures
-from the IBM temperature sensors (N=0..7) Sensor 0 is
-on the CPU, 3 is on the GPU.
-
-.TP
-\fBibm_volume\fR
-If running the IBM ACPI, displays the "master" volume,
-controlled by the volume keys (0-14).
-
-.TP
-\fBibm_brightness\fR
-If running the IBM ACPI, displays the brigtness of the
-laptops's LCD (0-7).
-
.SH EXAMPLES
.TP
conky \fB\-t '${time %D %H:%m}' \-o \-u 30\fR
<para></para></listitem>
</varlistentry>
+<varlistentry>
+ <term>
+ <command><option>freq</option></command>
+ <option>(n)</option>
+ </term>
+ <listitem>
+ Returns CPU #n's frequency in MHz. CPUs are
+ counted from 1. If omitted, the parameter
+ defaults to 1.
+ <para></para></listitem>
+</varlistentry>
+<varlistentry>
+ <term>
+ <command><option>freq_g</option></command>
+ <option>(n)</option>
+ </term>
+ <listitem>
+ Returns CPU #n's frequency in GHz. CPUs are
+ counted from 1. If omitted, the parameter
+ defaults to 1.
+ <para></para></listitem>
+</varlistentry>
- <varlistentry>
- <term>
- <command><option>freq</option></command>
- <option>(n)</option>
- </term>
- <listitem>
- Returns CPU #n's frequency in MHz. CPUs are
- counted from 1. If omitted, the parameter
- defaults to 1.
- <para></para></listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <command><option>freq_g</option></command>
- <option>(n)</option>
- </term>
- <listitem>
- Returns CPU #n's frequency in GHz. CPUs are
- counted from 1. If omitted, the parameter
- defaults to 1.
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term>
- <command><option>voltage_mv</option></command>
- <option>(n)</option>
- </term>
- <listitem>
- Returns CPU #n's voltage in mV. CPUs are
- counted from 1. If omitted, the parameter
- defaults to 1.
- <para></para></listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <command><option>voltage_v</option></command>
- <option>(n)</option>
- </term>
- <listitem>
- Returns CPU #n's voltage in V. CPUs are
- counted from 1. If omitted, the parameter
- defaults to 1.
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term>
- <command><option>freq_dyn</option></command>
- </term>
- <listitem>
+<varlistentry>
+ <term>
+ <command><option>freq_dyn</option></command>
+ </term>
+ <listitem>
Returns CPU frequency in MHz, but is calculated by counting to clock cycles to complete an instruction. Only available for x86/amd64.
<para></para></listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <command><option>freq_dyn_g</option></command>
- </term>
- <listitem>
- Returns CPU frequency in GHz, but is calculated by counting to clock cycles to complete an instruction. Only available for x86/amd64.
- <para></para></listitem>
- </varlistentry>
+</varlistentry>
+
+<varlistentry>
+ <term>
+ <command><option>freq_dyn_g</option></command>
+ </term>
+ <listitem>
+ Returns CPU frequency in GHz, but is calculated by counting to clock cycles to complete an instruction. Only available for x86/amd64.
+ <para></para></listitem>
+</varlistentry>
- <varlistentry>
+<varlistentry>
<term>
<command><option>fs_bar</option></command>
<option>(height),(width) fs</option>
<para></para></listitem>
</varlistentry>
+<varlistentry>
+ <term>
+ <command><option>ibm_fan</option></command>
+ </term>
+ <listitem>
+ If running the IBM ACPI, displays the fan speed.
+ <para></para></listitem>
+</varlistentry>
+
+<varlistentry>
+ <term>
+ <command><option>ibm_temps</option></command>
+ <option>N</option>
+ </term>
+ <listitem>
+ If running the IBM ACPI, displays the temperatures
+ from the IBM temperature sensors (N=0..7) Sensor 0 is
+ on the CPU, 3 is on the GPU.
+ <para></para></listitem>
+</varlistentry>
+
+<varlistentry>
+ <term>
+ <command><option>ibm_volume</option></command>
+ </term>
+ <listitem>
+ If running the IBM ACPI, displays the "master" volume,
+ controlled by the volume keys (0-14).
+ <para></para></listitem>
+</varlistentry>
+
+<varlistentry>
+ <term>
+ <command><option>ibm_brightness</option></command>
+ </term>
+ <listitem>
+ If running the IBM ACPI, displays the brigtness of the
+ laptops's LCD (0-7).
+ <para></para></listitem>
+</varlistentry>
+
<varlistentry>
<term>
Seti@home total user credit
<para></para></listitem>
</varlistentry>
+
<varlistentry>
<term>
<command><option>voffset</option></command>
<varlistentry>
<term>
+ <command><option>voltage_mv</option></command>
+ <option>(n)</option>
+ </term>
+ <listitem>
+ Returns CPU #n's voltage in mV. CPUs are
+ counted from 1. If omitted, the parameter
+ defaults to 1.
+ <para></para></listitem>
+</varlistentry>
+
+<varlistentry>
+ <term>
+ <command><option>voltage_v</option></command>
+ <option>(n)</option>
+ </term>
+ <listitem>
+ Returns CPU #n's voltage in V. CPUs are
+ counted from 1. If omitted, the parameter
+ defaults to 1.
+ <para></para></listitem>
+</varlistentry>
+
+<varlistentry>
+ <term>
<command><option>xmms_bar</option></command>
<option>(height),(width)</option>
</term>
<para></para></listitem>
</varlistentry>
-<varlistentry>
- <term>
- <command><option>ibm_fan</option></command>
- </term>
- <listitem>
- If running the IBM ACPI, displays the fan speed.
- <para></para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term>
- <command><option>ibm_temps</option></command>
- <option>N</option>
- </term>
- <listitem>
- If running the IBM ACPI, displays the temperatures
- from the IBM temperature sensors (N=0..7) Sensor 0 is
- on the CPU, 3 is on the GPU.
- <para></para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term>
- <command><option>ibm_volume</option></command>
- </term>
- <listitem>
- If running the IBM ACPI, displays the "master" volume,
- controlled by the volume keys (0-14).
- <para></para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term>
- <command><option>ibm_brightness</option></command>
- </term>
- <listitem>
- If running the IBM ACPI, displays the brigtness of the
- laptops's LCD (0-7).
- <para></para></listitem>
-</varlistentry>
-
</variablelist>
/* charging */
if (strcmp(charging_state, "charging") == 0) {
if (acpi_last_full != 0 && present_rate > 0) {
- strcpy(last_battery_str, "charging ");
+ strncpy(last_battery_str, "charging ", 64);
format_seconds(last_battery_str + 9,
63 - 9,
(acpi_last_full -
60 / present_rate);
} else if (acpi_last_full != 0
&& present_rate <= 0) {
- sprintf(last_battery_str, "charging %d%%",
+ snprintf(last_battery_str, 64, "charging %d%%",
remaining_capacity * 100 /
acpi_last_full);
} else {
- strcpy(last_battery_str, "charging");
+ strncpy(last_battery_str, "charging", 63);
}
}
/* discharging */
- else if (strcmp(charging_state, "discharging") == 0) {
- if (present_rate > 0)
+ else if (strncmp(charging_state, "discharging", 64) == 0) {
+ if (present_rate > 0) {
format_seconds(last_battery_str, 63,
(remaining_capacity * 60 *
60) / present_rate);
- else
- sprintf(last_battery_str,
+ } else if (present_rate == 0) { /* Thanks to Nexox for this one */
+ snprintf(last_battery_str, 64, "full");
+ } else {
+ snprintf(last_battery_str, 64,
"discharging %d%%",
remaining_capacity * 100 /
acpi_last_full);
+ }
}
/* charged */
/* thanks to Lukas Zapletal <lzap@seznam.cz> */
- else if (strcmp(charging_state, "charged") == 0) {
+ else if (strncmp(charging_state, "charged", 64) == 0) {
strcpy(last_battery_str, "charged");
}
/* unknown, probably full / AC */
else {
if (acpi_last_full != 0
&& remaining_capacity != acpi_last_full)
- sprintf(last_battery_str, "unknown %d%%",
+ snprintf(last_battery_str, 64, "unknown %d%%",
remaining_capacity * 100 /
acpi_last_full);
else
- strcpy(last_battery_str, "AC");
+ strncpy(last_battery_str, "AC", 64);
}
} else {
/* APM */