* Added $voffset
* Removed metar code. It sucked.
* Added $acpitempf for amooricans
+ * $tail fixes
2005-08-12
* Multiple unit additions and modifications
To compile and run Conky with all optional components (If you run Gentoo, see the "Ebuild" Section below):
- ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-double-buffer --enable-own-window --enable-proc-uptime --enable-mpd --enable-xft --enable-metar --enable-seti
+ ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-double-buffer --enable-own-window --enable-proc-uptime --enable-mpd --enable-xft --enable-seti
make
./conky
gap_y Gap between top or bottom border of screen, same as passing -y at command line
no_buffers Substract (file system) buffers from used memory?
mail_spool Mail spool for mail checking
- metar_station METAR station code for weather, see http://www.wrh.noaa.gov/ if you need to find your code.
- metar_server Define a custom METAR ftp server
- metar_path Path on server to use
minimum_size Minimum size of window
mldonkey_hostname Hostname for mldonkey stuff, defaults to localhost
mldonkey_port Mldonkey port, 4001 default
memmax Total amount of memory
memperc Percentage of memory in use
- metar_ob_time
- metar_temp
- metar_tempf Temp in F
- metar_windchill
- metar_dew_point There are a bunch of these
- metar_rh and they are self-explanatory
- metar_windspeed Windspeed in knots
- metar_windspeed_km Windspeed in km/hr
- metar_windspeed_mph Windspeed in mph
- metar_winddir
- metar_swinddir
- metar_cloud
- metar_u2d_time
-
ml_upload_counter total session upload in mb
ml_download_counter total session download in mb
ml_nshared_files number of shared files
typedef struct tailstring_list {
char data[TEXT_BUFFER_SIZE];
struct tailstring_list *next;
+ struct tailstring_list *first;
} tailstring;
void addtail(tailstring ** head, char *data_in)
if ((tmp = malloc(sizeof(*tmp))) == NULL) {
CRIT_ERR("malloc");
}
+ if (*head == NULL) {
+ tmp->first = tmp;
+ } else {
+ tmp->first = (*head)->first;
+ }
strncpy(tmp->data, data_in, TEXT_BUFFER_SIZE);
tmp->next = *head;
*head = tmp;
void freetail(tailstring * head)
{
tailstring *tmp;
-
while (head != NULL) {
tmp = head->next;
free(head);
}
}
-
+void freelasttail(tailstring * head)
+{
+ tailstring * tmp = head;
+ while(tmp != NULL) {
+ if (tmp->next == head->first) {
+ tmp->next = NULL;
+ break;
+ }
+ tmp = tmp->next;
+ }
+ free(head->first);
+ while(head != NULL && tmp != NULL) {
+ head->first = tmp;
+ head = head->next;
+ }
+}
static void new_bar(char *buf, int w, int h, int usage)
{
obj->data.tail.last_update = current_update_time;
FILE *fp;
int i;
+ int added = 0;
tailstring *head = NULL;
tailstring *headtmp = NULL;
fp = fopen(obj->data.tail.logfile, "rt");
obj->data.tail.readlines = 0;
while (fgets(obj->data.tail.buffer, TEXT_BUFFER_SIZE*4, fp) != NULL) {
+ if (added >= 30) {
+ freelasttail(head);
+ }
+ else {
+ added++;
+ }
addtail(&head, obj->data.tail.buffer);
obj->data.tail.readlines++;
}
else
#endif
{
+ XClearWindow(display, RootWindow(display, screen));
clear_text(1);
XFlush(display);
}
# mldonkey_login Mldonkey login, default none
# mldonkey_password Mldonkey password, default none
-# METAR station code for weather, get codes from weather.noaa.gov or google
-# or http://www.maltalinks.com/weather/ (thanks Hopeless @ f.g.o)
-metar_station CYBW
-
-# METAR ftp server
-# metar_server weather.noaa.gov
-
-# METAR path on server
-# metar_path /data/observations/metar/stations
-
# boinc (seti) dir
# seti_dir /opt/seti
${color #ddaa00} ${top_mem name 1} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${color lightgrey} ${top_mem name 2} ${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${color lightgrey} ${top_mem name 3} ${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
-${color}Current conditions: ${color lightgrey}${metar_temp}C $metar_cloud
${tail /var/log/Xorg.0.log 3 30}
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--datadir=/usr/ share --sysconfdir=/etc --localstatedir=/var/lib
--enable-double-buffer --enable-own-window --enable-proc-uptime
- --enable-mpd --enable-xft --enable-metar --enable-seti</option>
+ --enable-mpd --enable-xft --enable-seti</option>
</term>
</varlistentry>
<varlistentry>