mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-17 18:45:10 +00:00
* Add option to specify number of retries for IMAP/POP3 stuff (via -r)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1233 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
4fc4ece8c1
commit
961b70b6e6
@ -1,7 +1,10 @@
|
||||
# $Id$
|
||||
|
||||
2008-08-05
|
||||
* Add option to specify number of retries for IMAP/POP3 stuff (via -r)
|
||||
|
||||
2008-08-03
|
||||
* smaller $nvidia improvements
|
||||
* Smaller $nvidia improvements
|
||||
|
||||
2008-07-29
|
||||
* Added missing header to package dist
|
||||
|
54
README
54
README
@ -243,10 +243,11 @@ conky(1) conky(1)
|
||||
|
||||
|
||||
1mimap 22mDefault global IMAP server. Arguments are: "host user pass [-i
|
||||
interval] [-f folder] [-p port] [-e command]". Default port is
|
||||
143, default folder is ’INBOX’, default interval is 5 minutes.
|
||||
If the password is supplied as ’*’, you will be prompted to en‐
|
||||
ter the password when Conky starts.
|
||||
interval] [-f folder] [-p port] [-e command] [-r retries]". De‐
|
||||
fault port is 143, default folder is ’INBOX’, default interval
|
||||
is 5 minutes, and default number of retries before giving up is
|
||||
5. If the password is supplied as ’*’, you will be prompted to
|
||||
enter the password when Conky starts.
|
||||
|
||||
|
||||
1mmail_spool0m
|
||||
@ -364,9 +365,10 @@ conky(1) conky(1)
|
||||
|
||||
|
||||
1mpop3 22mDefault global POP3 server. Arguments are: "host user pass [-i
|
||||
interval] [-p port] [-e command]". Default port is 110, default
|
||||
interval is 5 minutes. If the password is supplied as ’*’, you
|
||||
will be prompted to enter the password when Conky starts.
|
||||
interval] [-p port] [-e command] [-r retries]". Default port is
|
||||
110, default interval is 5 minutes, and default number of re‐
|
||||
tries before giving up is 5. If the password is supplied as ’*’,
|
||||
you will be prompted to enter the password when Conky starts.
|
||||
|
||||
|
||||
1mshort_units0m
|
||||
@ -983,8 +985,9 @@ conky(1) conky(1)
|
||||
Displays the number of messages in your global IMAP inbox by de‐
|
||||
fault. You can define individual IMAP inboxes seperately by
|
||||
passing arguments to this object. Arguments are: "host user pass
|
||||
[-i interval] [-p port] [-e command]". Default port is 143, de‐
|
||||
fault interval is 5 minutes. If the password is supplied as ’*’,
|
||||
[-i interval] [-p port] [-e command] [-r retries]". Default port
|
||||
is 143, default interval is 5 minutes, and default number of re‐
|
||||
tries before giving up is 5. If the password is supplied as ’*’,
|
||||
you will be prompted to enter the password when Conky starts.
|
||||
|
||||
|
||||
@ -992,8 +995,9 @@ conky(1) conky(1)
|
||||
Displays the number of unseen messages in your global IMAP inbox
|
||||
by default. You can define individual IMAP inboxes seperately by
|
||||
passing arguments to this object. Arguments are: "host user pass
|
||||
[-i interval] [-p port] [-e command]". Default port is 143, de‐
|
||||
fault interval is 5 minutes. If the password is supplied as ’*’,
|
||||
[-i interval] [-p port] [-e command] [-r retries]". Default port
|
||||
is 143, default interval is 5 minutes, and default number of re‐
|
||||
tries before giving up is 5. If the password is supplied as ’*’,
|
||||
you will be prompted to enter the password when Conky starts.
|
||||
|
||||
|
||||
@ -1161,11 +1165,15 @@ conky(1) conky(1)
|
||||
|
||||
1mnvidia threshold temp gpufreq memfreq imagequality0m
|
||||
Nvidia graficcard support for the XNVCtrl library. Each option
|
||||
gives back one integer value: (threshold): the thresholdtempera‐
|
||||
ture at which the gpu slows down (temp): gives the gpu current
|
||||
temperature (gpufreq): gives the current gpu frequency (mem‐
|
||||
freq): gives the current mem frequency (imagequality): which im‐
|
||||
agequality should be choosen by OpenGL applications
|
||||
can be shortened to the least significant part. Temperatures
|
||||
are printed as float, all other values as integer.
|
||||
|
||||
1mthreshold22m: the thresholdtemperature at which the gpu slows down
|
||||
1mtemp22m: gives the gpu current temperature
|
||||
1mgpufreq22m: gives the current gpu frequency
|
||||
1mmemfreq22m: gives the current mem frequency
|
||||
1mimagequality22m: which imagequality should be choosen by OpenGL ap‐
|
||||
plications
|
||||
|
||||
|
||||
1moutlinecolor (color)0m
|
||||
@ -1201,8 +1209,9 @@ conky(1) conky(1)
|
||||
Displays the number of unseen messages in your global POP3 inbox
|
||||
by default. You can define individual POP3 inboxes seperately by
|
||||
passing arguments to this object. Arguments are: "host user pass
|
||||
[-i interval] [-p port] [-e command]". Default port is 110, de‐
|
||||
fault interval is 5 minutes. If the password is supplied as ’*’,
|
||||
[-i interval] [-p port] [-e command] [-r retries]". Default port
|
||||
is 110, default interval is 5 minutes, and default number of re‐
|
||||
tries before giving up is 5. If the password is supplied as ’*’,
|
||||
you will be prompted to enter the password when Conky starts.
|
||||
|
||||
|
||||
@ -1210,10 +1219,11 @@ conky(1) conky(1)
|
||||
Displays the amount of space (in MiB, 2^20) used in your global
|
||||
POP3 inbox by default. You can define individual POP3 inboxes
|
||||
seperately by passing arguments to this object. Arguments are:
|
||||
"host user pass [-i interval] [-p port] [-e command]". Default
|
||||
port is 110, default interval is 5 minutes. If the password is
|
||||
supplied as ’*’, you will be prompted to enter the password when
|
||||
Conky starts.
|
||||
"host user pass [-i interval] [-p port] [-e command] [-r re‐
|
||||
tries]". Default port is 110, default interval is 5 minutes, and
|
||||
default number of retries before giving up is 5. If the password
|
||||
is supplied as ’*’, you will be prompted to enter the password
|
||||
when Conky starts.
|
||||
|
||||
|
||||
1mpre_exec shell command0m
|
||||
|
@ -137,7 +137,7 @@
|
||||
<varlistentry>
|
||||
<term><command><option>imap</option></command></term>
|
||||
<listitem>
|
||||
Default global IMAP server. Arguments are: "host user pass [-i interval] [-f folder] [-p port] [-e command]". Default port is 143, default folder is 'INBOX', default interval is 5 minutes. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
Default global IMAP server. Arguments are: "host user pass [-i interval] [-f folder] [-p port] [-e command] [-r retries]". Default port is 143, default folder is 'INBOX', default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
<para></para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -325,7 +325,7 @@
|
||||
<varlistentry>
|
||||
<term><command><option>pop3</option></command></term>
|
||||
<listitem>
|
||||
Default global POP3 server. Arguments are: "host user pass [-i interval] [-p port] [-e command]". Default port is 110, default interval is 5 minutes. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
Default global POP3 server. Arguments are: "host user pass [-i interval] [-p port] [-e command] [-r retries]". Default port is 110, default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
<para></para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
37
doc/conky.1
37
doc/conky.1
@ -1,4 +1,4 @@
|
||||
'\" -*- coding: us-ascii -*-
|
||||
.\" -*- coding: us-ascii -*-
|
||||
.if \n(.g .ds T< \\FC
|
||||
.if \n(.g .ds T> \\F[\n[.fam]]
|
||||
.de URL
|
||||
@ -225,7 +225,7 @@ How strict should if_up be when testing an interface for being up? The value is
|
||||
|
||||
.TP
|
||||
\fB\*(T<\fBimap\fR\*(T>\fR
|
||||
Default global IMAP server. Arguments are: "host user pass [-i interval] [-f folder] [-p port] [-e command]". Default port is 143, default folder is 'INBOX', default interval is 5 minutes. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
Default global IMAP server. Arguments are: "host user pass [-i interval] [-f folder] [-p port] [-e command] [-r retries]". Default port is 143, default folder is 'INBOX', default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
|
||||
.TP
|
||||
\fB\*(T<\fBmail_spool\fR\*(T>\fR
|
||||
@ -328,7 +328,7 @@ Pad percentages to this many decimals (0 = no padding)
|
||||
|
||||
.TP
|
||||
\fB\*(T<\fBpop3\fR\*(T>\fR
|
||||
Default global POP3 server. Arguments are: "host user pass [-i interval] [-p port] [-e command]". Default port is 110, default interval is 5 minutes. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
Default global POP3 server. Arguments are: "host user pass [-i interval] [-p port] [-e command] [-r retries]". Default port is 110, default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
|
||||
.TP
|
||||
\fB\*(T<\fBshort_units\fR\*(T>\fR
|
||||
@ -835,11 +835,11 @@ if INTERFACE exists and is up, display everything between $if_up and the matchin
|
||||
|
||||
.TP
|
||||
\fB\*(T<\fBimap_messages\fR\*(T>\fR \*(T<\fB(args)\fR\*(T>
|
||||
Displays the number of messages in your global IMAP inbox by default. You can define individual IMAP inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command]". Default port is 143, default interval is 5 minutes. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
Displays the number of messages in your global IMAP inbox by default. You can define individual IMAP inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command] [-r retries]". Default port is 143, default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
|
||||
.TP
|
||||
\fB\*(T<\fBimap_unseen\fR\*(T>\fR \*(T<\fB(args)\fR\*(T>
|
||||
Displays the number of unseen messages in your global IMAP inbox by default. You can define individual IMAP inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command]". Default port is 143, default interval is 5 minutes. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
Displays the number of unseen messages in your global IMAP inbox by default. You can define individual IMAP inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command] [-r retries]". Default port is 143, default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
|
||||
.TP
|
||||
\fB\*(T<\fBioscheduler\fR\*(T>\fR \*(T<\fBdisk\fR\*(T>
|
||||
@ -996,12 +996,23 @@ Hostname
|
||||
.TP
|
||||
\fB\*(T<\fBnvidia\fR\*(T>\fR \*(T<\fBthreshold\fR\*(T> \*(T<\fBtemp\fR\*(T> \*(T<\fBgpufreq\fR\*(T> \*(T<\fBmemfreq\fR\*(T> \*(T<\fBimagequality\fR\*(T>
|
||||
Nvidia graficcard support for the XNVCtrl library.
|
||||
Each option gives back one integer value:
|
||||
(threshold): the thresholdtemperature at which the gpu slows down
|
||||
(temp): gives the gpu current temperature
|
||||
(gpufreq): gives the current gpu frequency
|
||||
(memfreq): gives the current mem frequency
|
||||
(imagequality): which imagequality should be choosen by OpenGL applications
|
||||
Each option can be shortened to the least significant part.
|
||||
Temperatures are printed as float, all other values as integer.
|
||||
|
||||
\fBthreshold\fR:
|
||||
the thresholdtemperature at which the gpu slows down
|
||||
.br
|
||||
\fBtemp\fR:
|
||||
gives the gpu current temperature
|
||||
.br
|
||||
\fBgpufreq\fR:
|
||||
gives the current gpu frequency
|
||||
.br
|
||||
\fBmemfreq\fR:
|
||||
gives the current mem frequency
|
||||
.br
|
||||
\fBimagequality\fR:
|
||||
which imagequality should be choosen by OpenGL applications
|
||||
|
||||
.TP
|
||||
\fB\*(T<\fBoutlinecolor\fR\*(T>\fR \*(T<\fB(color)\fR\*(T>
|
||||
@ -1037,11 +1048,11 @@ Platform sensor from sysfs (Linux 2.6). Parameter dev may be omitted if you have
|
||||
|
||||
.TP
|
||||
\fB\*(T<\fBpop3_unseen\fR\*(T>\fR \*(T<\fB(args)\fR\*(T>
|
||||
Displays the number of unseen messages in your global POP3 inbox by default. You can define individual POP3 inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command]". Default port is 110, default interval is 5 minutes. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
Displays the number of unseen messages in your global POP3 inbox by default. You can define individual POP3 inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command] [-r retries]". Default port is 110, default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
|
||||
.TP
|
||||
\fB\*(T<\fBpop3_used\fR\*(T>\fR \*(T<\fB(args)\fR\*(T>
|
||||
Displays the amount of space (in MiB, 2^20) used in your global POP3 inbox by default. You can define individual POP3 inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command]". Default port is 110, default interval is 5 minutes. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
Displays the amount of space (in MiB, 2^20) used in your global POP3 inbox by default. You can define individual POP3 inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command] [-r retries]". Default port is 110, default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
|
||||
.TP
|
||||
\fB\*(T<\fBpre_exec\fR\*(T>\fR \*(T<\fBshell command\fR\*(T>
|
||||
|
@ -1079,7 +1079,7 @@
|
||||
<option>(args)</option>
|
||||
</term>
|
||||
<listitem>
|
||||
Displays the number of messages in your global IMAP inbox by default. You can define individual IMAP inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command]". Default port is 143, default interval is 5 minutes. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
Displays the number of messages in your global IMAP inbox by default. You can define individual IMAP inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command] [-r retries]". Default port is 143, default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
<para></para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -1089,7 +1089,7 @@
|
||||
<option>(args)</option>
|
||||
</term>
|
||||
<listitem>
|
||||
Displays the number of unseen messages in your global IMAP inbox by default. You can define individual IMAP inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command]". Default port is 143, default interval is 5 minutes. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
Displays the number of unseen messages in your global IMAP inbox by default. You can define individual IMAP inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command] [-r retries]". Default port is 143, default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
<para></para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -1535,7 +1535,7 @@
|
||||
<option>(args)</option>
|
||||
</term>
|
||||
<listitem>
|
||||
Displays the number of unseen messages in your global POP3 inbox by default. You can define individual POP3 inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command]". Default port is 110, default interval is 5 minutes. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
Displays the number of unseen messages in your global POP3 inbox by default. You can define individual POP3 inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command] [-r retries]". Default port is 110, default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
|
||||
<para></para></listitem>
|
||||
</varlistentry>
|
||||
@ -1546,7 +1546,7 @@
|
||||
<option>(args)</option>
|
||||
</term>
|
||||
<listitem>
|
||||
Displays the amount of space (in MiB, 2^20) used in your global POP3 inbox by default. You can define individual POP3 inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command]". Default port is 110, default interval is 5 minutes. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
Displays the amount of space (in MiB, 2^20) used in your global POP3 inbox by default. You can define individual POP3 inboxes seperately by passing arguments to this object. Arguments are: "host user pass [-i interval] [-p port] [-e command] [-r retries]". Default port is 110, default interval is 5 minutes, and default number of retries before giving up is 5. If the password is supplied as '*', you will be prompted to enter the password when Conky starts.
|
||||
|
||||
<para></para></listitem>
|
||||
</varlistentry>
|
||||
|
11
src/conky.c
11
src/conky.c
@ -1575,6 +1575,13 @@ struct mail_s *parse_mail_args(char type, const char *arg)
|
||||
tcsetattr(fp, TCSANOW, &term);
|
||||
}
|
||||
// now we check for optional args
|
||||
tmp = strstr(arg, "-r ");
|
||||
if (tmp) {
|
||||
tmp += 3;
|
||||
sscanf(tmp, "%u", &mail->retries);
|
||||
} else {
|
||||
mail->retries = 5; // 5 retries after failure
|
||||
}
|
||||
tmp = strstr(arg, "-i ");
|
||||
if (tmp) {
|
||||
tmp += 3;
|
||||
@ -1648,7 +1655,7 @@ void *imap_thread(void *arg)
|
||||
exit(1);
|
||||
}
|
||||
#endif /* HAVE_GETHOSTBYNAME_R */
|
||||
while (fail < 5) {
|
||||
while (fail < mail->retries) {
|
||||
struct timeval timeout;
|
||||
int res;
|
||||
fd_set fdset;
|
||||
@ -1844,7 +1851,7 @@ void *pop3_thread(void *arg)
|
||||
exit(1);
|
||||
}
|
||||
#endif /* HAVE_GETHOSTBYNAME_R */
|
||||
while (fail < 5) {
|
||||
while (fail < mail->retries) {
|
||||
struct timeval timeout;
|
||||
int res;
|
||||
fd_set fdset;
|
||||
|
@ -156,6 +156,7 @@ struct mail_s { // for imap and pop3
|
||||
unsigned long used;
|
||||
unsigned long quota;
|
||||
unsigned long port;
|
||||
unsigned long retries;
|
||||
float interval;
|
||||
double last_update;
|
||||
char host[128];
|
||||
|
Loading…
Reference in New Issue
Block a user