2016-11-28 03:52:36 +00:00
|
|
|
--- wmjmail.c Sat Apr 14 10:15:14 2001
|
|
|
|
+++ wmjmail.c.3 Sat Apr 14 10:13:35 2001
|
|
|
|
@@ -20,6 +20,7 @@
|
|
|
|
//#define APPLICATION "xterm -sb -sl 2000 +si +sk -title XTerm -fg black -bg wheat -geometry 71x50-0-0 -e mutt &"
|
2016-12-23 23:28:17 +00:00
|
|
|
|
2016-11-28 03:52:36 +00:00
|
|
|
int dontread = 0;
|
|
|
|
+static char my_cmd[350];
|
|
|
|
static char my_folder[256];
|
|
|
|
static char my_app[256];
|
|
|
|
static char my_audio[512];
|
|
|
|
@@ -62,6 +63,7 @@
|
|
|
|
}
|
|
|
|
}
|
2016-12-23 23:28:17 +00:00
|
|
|
|
2016-11-28 03:52:36 +00:00
|
|
|
+ snprintf (my_cmd, 350, "mailchk %s", my_folder);
|
|
|
|
snprintf (my_audio, 511, "%s %s &", my_aplayer, my_afile);
|
2016-12-23 23:28:17 +00:00
|
|
|
|
2016-11-28 03:52:36 +00:00
|
|
|
set_update_delay((i) ? i : 15); /* seconds */
|
|
|
|
@@ -74,20 +76,19 @@
|
|
|
|
struct stat buf;
|
2016-12-23 23:28:17 +00:00
|
|
|
|
2016-11-28 03:52:36 +00:00
|
|
|
if ( stat (my_folder, &buf) != 0 ) {
|
|
|
|
- perror ("");
|
|
|
|
- fprintf (stderr, "Could not stat '%s'\n", my_folder);
|
|
|
|
- exit (-2);
|
|
|
|
+ //perror ("");
|
|
|
|
+ //fprintf (stderr, "Could not stat '%s'\n", my_folder);
|
|
|
|
+ //exit (-2);
|
|
|
|
+ buf.st_size = 0;
|
|
|
|
}
|
2016-12-23 23:28:17 +00:00
|
|
|
|
2016-11-28 03:52:36 +00:00
|
|
|
if ( size != buf.st_size ) {
|
|
|
|
- FILE *f = popen ("mailchk", "r");
|
|
|
|
+ FILE *f = popen (my_cmd, "r");
|
|
|
|
fscanf (f, "%i - %i - %i", &my_new, &my_tot, &my_read);
|
|
|
|
pclose (f);
|
2016-12-23 23:28:17 +00:00
|
|
|
|
2016-11-28 03:52:36 +00:00
|
|
|
/* Do not play on startup, and only on NEW mails */
|
|
|
|
- if ( size != 0 &&
|
|
|
|
- size < buf.st_size )
|
|
|
|
- {
|
|
|
|
+ if ( size != 0 && size < buf.st_size ) {
|
|
|
|
system (my_audio);
|
|
|
|
}
|
2016-12-23 23:28:17 +00:00
|
|
|
|