diff --git a/README b/README index a955a22b..d08837e4 100644 --- a/README +++ b/README @@ -784,6 +784,24 @@ VARIABLES Change outline color + pb_battery item + If running on Apple powerbook/ibook, display information on bat- + tery status. The item parameter specifies, what information to + display. Exactly one item must be specified. Valid items are: + + status: Display if battery is fully charged, charging, discharg- + ing or absent (running on AC) + + percent: Display charge of battery in percent, if charging or + discharging. Nothing will be displayed, if battery is fully + charged or absent. + + time: Display the time remaining until the battery will be fully + charged or discharged at current rate. Nothing is displayed, if + battery is absent or if it's present but fully charged and not + discharging. + + pre_exec shell command Executes a shell command one time before conky displays anything and puts output as text. @@ -1082,4 +1100,4 @@ AUTHORS - 2006-04-15 conky(1) + 2006-04-23 conky(1) diff --git a/doc/conky.1 b/doc/conky.1 index db145706..af07b5a1 100644 --- a/doc/conky.1 +++ b/doc/conky.1 @@ -1,5 +1,5 @@ .\" -*- coding: us-ascii -*- -.TH conky 1 2006-04-15 +.TH conky 1 2006-04-23 .SH NAME conky \- A system monitor for X originally based on the torsmo code, but more kickass. It just keeps on given'er. Yeah. .SH SYNOPSIS @@ -708,6 +708,30 @@ Hostname \fBoutlinecolor\fR \fB(color)\fR Change outline color +.TP +\fBpb_battery\fR \fBitem\fR +If running on Apple powerbook/ibook, display +information on battery status. The item parameter +specifies, what information to display. Exactly one item +must be specified. Valid items are: + +status: +Display if battery is fully charged, charging, +discharging or absent (running on AC) + +percent: +Display charge of battery in percent, if +charging or discharging. Nothing will be +displayed, if battery is fully charged +or absent. + +time: +Display the time remaining until the battery +will be fully charged or discharged at current +rate. Nothing is displayed, if battery is +absent or if it's present but fully charged +and not discharging. + .TP \fBpre_exec\fR \fBshell command\fR Executes a shell command one time before conky displays anything and puts output as text. diff --git a/src/conky.h b/src/conky.h index 90f72eba..8e3dee4d 100644 --- a/src/conky.h +++ b/src/conky.h @@ -464,7 +464,7 @@ struct ibm_acpi_struct { struct ibm_acpi_struct ibm_acpi; enum { PB_BATT_STATUS, PB_BATT_PERCENT, PB_BATT_TIME}; -void get_powerbook_batt_info(char* buf, size_t size, int i); +void get_powerbook_batt_info(char*, size_t, int); struct process { struct process *next; diff --git a/src/linux.c b/src/linux.c index 7ab0372e..240cae58 100644 --- a/src/linux.c +++ b/src/linux.c @@ -1264,7 +1264,7 @@ static char pb_battery_info[3][32]; static double pb_battery_info_update; #define PMU_PATH "/proc/pmu" -void get_powerbook_batt_info(char *buf, unsigned int n, int i) +void get_powerbook_batt_info(char *buf, size_t n, int i) { static int rep; const char* batt_path = PMU_PATH "/battery_0";