xlassie-1.8/ 40755 764 144 0 7304674727 11576 5ustar xyzzyusersxlassie-1.8/Makefile100644 764 144 1147 7304674725 13334 0ustar xyzzyusersLIBS = -L/usr/X11R6/lib -lXext -lX11 CFLAGS = -O2 -fomit-frame-pointer -pipe -Wall #CFLAGS = -g -pipe # Use this for solaris #LIBS = -L/usr/openwin/lib -lsocket -lnsl -lresolv -lXext -lX11 #CFLAGS = -O2 -pipe -Wall all: xlassie xlassie: xlassie.o socket.o gcc $(CFLAGS) -o xlassie xlassie.o socket.o $(LIBS) xlassie.o: xlassie.c defaults.h gcc $(CFLAGS) -c xlassie.c socket.o: socket.c defaults.h gcc $(CFLAGS) -c socket.c dist: clean @(dir=`pwd`; name=`basename $$dir`; \ rm -f $$name.tar.gz ; \ cd .. ; tar -zcf $$name/$$name.tar.gz --exclude $$name/$$name.tar.gz $$name ) clean: -rm -f *.o xlassie xlassie-1.8/README100644 764 144 15567 7242774705 12607 0ustar xyzzyusersTo compile, just type make. Non-Linux systems will probably need to change the CFLAGS and LIBS. You can edit the file defaults.h to change some of the defaults to suit you better. For instance, if you don't like (or don't have) the default font, you can change it in the defaults.h file rather than putting an awkward font name on the command line every time. If you get some error about font not found, you don't have the right font. The default fonts are at the end of the defaults.h file, you can just change them to a font you do have. Use -help to get a summary of the options. Most do the same thing as the options in xbiff. Options for features not present in xbiff are: For news and updates, visit the XLassie home page at: http://www.speakeasy.org/~xyzzy/xlassie/ -------------------------------------------------------------- -mailcommand Specify a command to run when new mail is received. If you have a %d in the command, it will get replaced with the number of new messages. Remember to put quotes around the command if it's longer than one word. If you want the command to run the background, put a '&' at the end. Some examples: Play an mp3 file when new mail comes in: xlassie -mailcommand "mpg123 newmail.mp3" Download mail from a pop/imap server: xlassie -pop3 pop.myisp.com -mailcommand "fetchmail pop.myisp.com" Speak the number of new messages with IBM's ViaVoice TTS for Linux: xlassie -mailcommand "cmdlinespeak You have %d new messages" -------------------------------------------------------------- -kde -nokde -wmaker -nowmaker New in xlassie 1.5 is the ability to detect KDE or WindowMaker running, and do some special stuff to get swallowed into the desktop's dock/taskbar. This is normally automatic. You can disable a certain mode with -nokde or -nowmaker, or force the mode to be on with -kde or -wmaker. In KDE mode a smaller default font is used (KDEFONT in defaults.h) so it will fit inside the small spot in the task bar. If you set the background color to the same color as your KDE dock, it looks a bit nicer. For WindowMaker a larger font is used (WMFONT) and shape mode is turned on, to look best inside a normal sized WindowMaker dock square. Xlassie 1.6 will work with KDE2 as well as KDE1. Note that the -kde option isn't going to do anything for you, if KDE isn't autodetected, then it's not going to work either, forcing kde mode will just crash. On the other hand, the -nokde option is useful if you don't want to dock the window in the panel. -------------------------------------------------------------- -command Lets you specify a command to be executed when the window is clicked on. The default command is specified in defaults.h. You should inclose the command in quotes if it's longer than one word. You will also probably want to stick an & on the end so the command runs in the background. Example usage: xlassie -command "xterm -e pine &" xlassie -command "fetchpop -r &" -------------------------------------------------------------- -pop3 or -apop3 or -imap -password -username These three options all go together for querying a POP3 or IMAP mailbox for new mail. The -pop3 option turns on POP3 mode and takes the name of the pop server as an argument. The -imap options works the same way, but will query an IMAP server. The -username lets you specify the username on the POP server. The name will default to the same name as you have locally. -password lets you specify the password to use on the POP/IMAP server. When xlassie runs it will write over the password in the argument lists, so someone doing a "ps" won't see your password. Example: xlassie -password foobar -pop3 mail.myisp.com The output of ps might look like this: PID TTY STAT TIME COMMAND 1132 p0 S 0:00 xlassie -password -pop3 mail.myisp.com 1134 p1 R 0:00 ps ***** NEW OPTION ******* * The -apop3 option is just like the -pop3 option, except it uses a different * method of querying for new mail. The default method doesn't work on some * pop servers. If, instead of the number of NEW message, xlassie displays the * total number of messages (old + new), then you have one of these pop * servers. The -apop3 method should work on these servers. However, this * method uses more more bandwidth to the pop server, since it needs to * download the message headers to figure out if you have read them or not. If you want to start xlassie from your .xinitrc or some other script, but don't want to put your password in it, there is an ask option. This is also good if you don't want to have a command with your password in the .bash_history file. Tell xlassie your password is 'ask', like this: xlassie -password ask -pop3 mail.myisp.com and you will get a prompt and can type in your password. You can send the password to xlassie via a pipe. For example: ssh-askpass "POP Password" | xlassie -password ask .... or xlassie -password ask .... < ~/.secret_password_file If your name on your machine is not the same as the name on the pop3 server, use the username option: xlassie -pop3 mailserver -password abcd -username bob123 -------------------------------------------------------------- -offline Works with the POP3/IMAP feature. Normally, when XLassie can't access the POP3 server for some reason, it will exit with an error message. In offline mode, it will not exit, but instead display an "X" as the number of messages. This way, you can leave XLassie running while your PPP link is down. It also serves as a useful way to tell you if you are connected to the Internet or not. -------------------------------------------------------------- -update The default is for xlassie to poll a local mail spool file for new mail every 5 seconds and a POP3 server every 60 seconds. You can change these defaults in the defaults.h file. The update option lets to specify the interval on the command line. xlassie -update 1 # I need to know now! xlassie -pop3 foo -password bar -update 300 # every 5 minutes -------------------------------------------------------------- Note for using multiple xlassies with FvwmButtons: If you have multiple xlassie's being swallowed by fvwmbuttons or some other program, you will have a hard time getting each button to swallow the correct instance of xlassie, since they all have the same name. To fix this, use the -name option. For example: *FvwmButtons(Swallow xlassie1 "Exec xlassie -name xlassie1" \ Title Local) *FvwmButtons(Swallow xlassie2 "Exec xlassie -name xlassie2 -pop3 blah blah" \ Title Remote) This will make two buttons, one called Local will have an xlassie that checks your local mail spool file, the other called Remote will check on a pop3 server. Each button will have the correct xlassie in them. xlassie-1.8/xlassie.c100644 764 144 53574 7304673346 13541 0ustar xyzzyusers/* Copyright (C) 1998 Trent Piepho * (C) 1999-2001 Trent Piepho * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "defaults.h" #define VERSION "1.8" /* X related globals */ Display *dpy; Window win; GC gc; XFontStruct *font; int Ascent=33,Descent=0; int Width=55,Height=33; XColor FgXColor,HiXColor; Pixmap ShapeMask; /* shape stuff */ GC ShapeGC; /* shape stuff */ int MaskWidth,MaskHeight; /* shape stuff */ Atom DeleteWindow; /* Atom of delete window message */ Atom KWMDockWindow; /* Atom for KWM hint */ /* app-default related globals */ char *FgColor="Black",*BgColor="White",*HiColor="Red"; char *FontName=NULL; char *DisplayName=NULL; char *AppName; int Number; int Interval=INTERVAL_SPOOL; char SpoolFile[256]; char Command[256]; char Username[32]; char Password[32]; char NewMailCommand[256]; char *Geometry=NULL; int Options=0; #define BELL_MODE 0x0001 #define COMMAND_MODE 0x0002 #define SHAPED_WINDOW 0x0004 #define HILIGHT_MAIL 0x0008 #define OFFLINE 0x0010 #define USE_POP3 0x0020 #define USE_APOP3 0x0040 #define USE_IMAP 0x0080 #define USE_MAILDIR 0x0100 #define WM_MODE 0x0200 #define KDE1_MODE 0x0400 #define KDE2_MODE 0x0800 #define NOKDE 0x1000 #define NOWM 0x2000 char *BackupFonts[3][4] = {{ FONTNAME, FONTNAME1, FONTNAME2, FONTNAME3 }, { KDEFONT, KDEFONT1, KDEFONT2, KDEFONT3 }, { WMFONT, WMFONT1, WMFONT2, WMFONT3 } }; void usage(); void update(); void handler(int); void parse_options(int argc,char *argv[]); void init(int argc,char *argv[]); int count_mail(); int count_mail_mbox(); void update() { static int old_number=-1; char str[32]; static int oldw=-1,oldh=-1; int w,h; if(Options&OFFLINE && Number==-1) { strcpy(str,"X"); } else { sprintf(str,"%d",Number); } w = (Width-XTextWidth(font,str,strlen(str)))/2; h = (Height+Ascent-Descent)/2; if(Options&SHAPED_WINDOW) { if(Number!=old_number || oldw!=w || oldh!=h) { old_number=Number; oldw=w; oldh=h; /* these next 3 lines clear the pixmap, is there a cleaner way? */ XSetFunction(dpy,ShapeGC,GXclear); XFillRectangle(dpy,ShapeMask,ShapeGC,0,0,MaskWidth,MaskHeight); XSetFunction(dpy,ShapeGC,GXset); XDrawString(dpy,ShapeMask,ShapeGC,0,Ascent,str,strlen(str)); XShapeCombineMask(dpy, win, ShapeBounding, w, h-Ascent, ShapeMask, ShapeSet); }; } else { XClearWindow(dpy,win); } if(Options&HILIGHT_MAIL) { XSetForeground(dpy,gc,Number?HiXColor.pixel:FgXColor.pixel); } XDrawString(dpy,win,gc,w,h,str,strlen(str)); } void handler(int nothing) { int old; old = Number; count_mail(); if(old==Number) return; update(); if(Number>old) { if(Options&BELL_MODE) XBell(dpy,100); if(Options&COMMAND_MODE) { char str[256]; sprintf(str, NewMailCommand, Number); system(str); } } XFlush(dpy); } void font_height(void) { int foo,bar,baz; XCharStruct extents; XTextExtents(font,"0123456789",10,&foo,&bar,&baz,&extents); Ascent=extents.ascent; Descent=extents.descent; } void usage(void) { printf("XLassie V" VERSION "\tby Trent Piepho \n"); printf("\thttp://www.speakeasy.org/~xyzzy/xlassie/\n"); printf("Usage: xlassie [-h] | [-options]\n"); printf("where options include:\n"); printf(" -h, -help Print usage\n"); printf(" -v, -version Print version\n"); printf(" -name Set app name\n"); printf(" -bg Background color [%s]\n",BgColor); printf(" -fg Foreground color [%s]\n",FgColor); printf(" -hilight [color] Use a different foreground color when there\n" " is non-zero mail [%s]\n", HiColor); printf(" -update Check mail every seconds\n" " default %d sec local, %d sec remote\n", INTERVAL_SPOOL, INTERVAL_POP3); printf(" -bell Ring bell when count increases from zero\n"); printf(" -mailcommand Command to execute on new mail arrival\n"); printf(" -fn Font for the new mail count\n"); printf(" -display X server to connect to\n"); printf(" -shape Use a shaped window\n"); printf(" -file File to use for mail spool or maildir directory\n"); printf(" -command Command to execute when clicked on\n"); #ifdef POP3 printf(" -pop3 Connect to pop3 server rather than local mail spool\n"); printf(" -apop3 Like -pop3, but uses a diferent method.\n"); printf(" Use when -pop3 doesn't find the correct number\n"); printf(" -imap Use the IMAP protocol instead of pop3\n"); printf(" -username Username for pop3/imap server\n" " if different from local username\n"); printf(" -password Password to use on pop3/imap server\n"); printf(" Use the password 'ask' to get prompted for\n" " the password on stdin.\n"); printf(" -offline Don't exit when the server is unreachable\n"); #endif printf(" -wmaker Do stuff to get swallowed into the WindowMaker dock\n"); printf(" -kde Do stuff to get swallowed into the KDE dock\n"); printf(" Normally KDE or WindowMaker is autodetected\n" " and you don't need to use the above options\n"); printf(" -nokde, -nowmaker Don't do the stuff to get swallowed\n"); } void ask_password() { int i; printf("Mail account password: "); fgets(Password, 32, stdin); i = strlen(Password)-1; if(Password[i]=='\n') Password[i]='\0'; } void parse_options(int argc,char *argv[]) { int i; int intervalused=0; for(i=1;iflags = PSize; xsh->width = Width; xsh->height = Height; /* printf("%d x %d\n", Width, Height);*/ g=XWMGeometry(dpy,screen,Geometry,NULL,0,xsh,&x,&y,&Width,&Height,&g); if(g&XValue) { xsh->x=x; xsh->flags|=USPosition; }; if(g&YValue) { xsh->y=y; xsh->flags|=USPosition; }; if(g&WidthValue) {xsh->width=Width; xsh->flags|=USSize; } else {Width = xsh->width; }; if(g&HeightValue) {xsh->height=Height; xsh->flags|=USSize; } else {Height = xsh->height; }; /* printf("%dx%d+%d+%d\n",Width,Height,x,y); printf("%s%s%s%s\n", (xsh->flags&USPosition)?"USPosition ":"", (xsh->flags&PPosition)?"PPosition ":"", (xsh->flags&USSize)?"USSize ":"", (xsh->flags&PSize)?"PSize ":""); */ win=XCreateSimpleWindow(dpy,RootWindow(dpy,screen),x,y,Width,Height,0, BlackPixel(dpy,screen),WhitePixel(dpy,screen)); wmh->initial_state=NormalState; wmh->input=False; wmh->window_group = win; wmh->flags = StateHint | InputHint | WindowGroupHint; classh->res_name = (AppName==NULL)?"xlassie":AppName; classh->res_class = "XBiff"; if(Options&WM_MODE) { /* WindowMaker stuff */ icon=XCreateSimpleWindow(dpy,RootWindow(dpy,screen),x,y,Width,Height, 0, BlackPixel(dpy,screen), WhitePixel(dpy,screen)); wmh->initial_state=WithdrawnState; wmh->icon_window=icon; wmh->flags |= IconWindowHint; XSetClassHint(dpy, icon, classh); XSelectInput(dpy, icon, ExposureMask|ButtonPressMask|StructureNotifyMask); } XmbSetWMProperties(dpy, win, "xlassie", "xlassie", argv, argc, xsh, wmh, classh); XSetWMProtocols(dpy, win, &DeleteWindow, 1); XSelectInput(dpy, win, ExposureMask|ButtonPressMask|StructureNotifyMask); if(Options&KDE1_MODE) { unsigned char data = 1; if(KWMDockWindow==None) { fprintf(stderr, "KDE1 mode isn't going to work, skipping\n"); } else { XChangeProperty(dpy, win, KWMDockWindow, KWMDockWindow, 8, PropModeReplace, &data, 1); } } if(Options&KDE2_MODE) { if(KWMDockWindow==None) { fprintf(stderr, "KDE2 mode isn't going to work, skipping\n"); } else { XChangeProperty(dpy, win, KWMDockWindow, XA_WINDOW, 32, PropModeReplace, (void*)&win, 1); } } XMapWindow(dpy, win); if(Options&WM_MODE) win = icon; /* Use the icon window from now on */ gc=XCreateGC(dpy,win,0,NULL); XAllocNamedColor(dpy,DefaultColormap(dpy,screen),FgColor,&color,&tmp); XSetForeground(dpy,gc,color.pixel); FgXColor=color; XAllocNamedColor(dpy,DefaultColormap(dpy,screen),BgColor,&color,&tmp); XSetBackground(dpy,gc,color.pixel); XSetWindowBackground(dpy,win,color.pixel); if(Options&HILIGHT_MAIL) XAllocNamedColor(dpy,DefaultColormap(dpy,screen), HiColor,&HiXColor,&tmp); XSetFont(dpy,gc,font->fid); if(Options&SHAPED_WINDOW) { MaskWidth = Width; MaskHeight = Height; ShapeMask = XCreatePixmap(dpy,win,MaskWidth,MaskHeight,1); ShapeGC = XCreateGC(dpy,ShapeMask,0,NULL); XSetFont(dpy,ShapeGC,font->fid); }; } int check_spool() { struct stat st; char str[PATH_MAX]; if(Options&(USE_POP3|USE_APOP3|USE_IMAP)) return 0; if(stat(SpoolFile, &st)) { perror("stat"); fprintf(stderr, "Can't seem to find your mail file/directory: '%s'\n", SpoolFile); exit(errno); } if(S_ISDIR(st.st_mode)) { Options|=USE_MAILDIR; /* Check for the subdir "new" and use it if it exists */ strcpy(str, SpoolFile); strcat(str, (str[strlen(str)-1]=='/')?"new":"/new"); if(!stat(str, &st) && S_ISDIR(st.st_mode)) { strcpy(SpoolFile, str); } } return 1; } int main(int argc,char *argv[]) { XEvent xev; Atom WM_PROTOCOLS; struct itimerval itv; struct sigaction sig; struct passwd* pwd; char *mail; pwd = getpwuid(getuid()); mail= getenv("MAIL"); if(mail==NULL) { sprintf(SpoolFile,"/var/spool/mail/%s", pwd->pw_name); } else { strcpy(SpoolFile, mail); } strcpy(Username,pwd->pw_name); strcpy(Command, COMMAND); init(argc,argv); check_spool(); WM_PROTOCOLS = XInternAtom(dpy, "WM_PROTOCOLS", False); #ifdef OFFLINE_DEFAULT Options|=OFFLINE; #endif count_mail(); if(Options&BELL_MODE && Number) XBell(dpy,100); sig.sa_handler=handler; sigemptyset(&sig.sa_mask); sig.sa_flags=SA_RESTART; sigaction(SIGALRM,&sig,NULL); itv.it_interval.tv_sec=Interval; itv.it_interval.tv_usec=0; itv.it_value = itv.it_interval; setitimer(ITIMER_REAL,&itv,NULL); for(;;) { XNextEvent(dpy,&xev); switch(xev.type) { case Expose: while(XCheckTypedEvent(dpy,Expose,&xev)); update(); break; case ButtonPress: system(Command); break; case ConfigureNotify: Width = xev.xconfigure.width; Height = xev.xconfigure.height; update(); break; case ClientMessage: if(xev.xclient.message_type == WM_PROTOCOLS) { if(xev.xclient.data.l[0] == DeleteWindow) { XCloseDisplay(dpy); exit(0); }; }; break; case DestroyNotify: XCloseDisplay(dpy); exit(0); default: }; }; } #ifdef POP3 int sock_connect(char *,int); FILE *pop_login() { int fd; FILE *f; char buf[256]; fd=sock_connect(SpoolFile,110); if(fd==-1) { if(Options&OFFLINE) { Number=-1; return NULL; } else { fprintf(stderr,"Error connecting to POP3 server %s\n",SpoolFile); exit(1); }; }; f=fdopen(fd,"r+"); fgets(buf,256,f); fflush(f); fprintf(f,"USER %s\r\n",Username); fflush(f); fgets(buf,256,f); if(buf[0]!='+') { fprintf(stderr,"Server doesn't like your name!\n"); fprintf(f,"QUIT\r\n");fclose(f); return NULL; }; fflush(f); fprintf(f,"PASS %s\r\n",Password); fflush(f); fgets(buf,256,f); if(buf[0]!='+') { fprintf(stderr,"Server doesn't like your password!\n"); fprintf(stderr,"It said %s",buf); fprintf(f,"QUIT\r\n");fclose(f); return NULL; }; return(f); } FILE *imap_login() { int fd; FILE *f; char buf[128]; fd=sock_connect(SpoolFile, 143); if(fd==-1) { if(Options&OFFLINE) { Number=-1; return NULL; } else { fprintf(stderr, "Error connecting to IMAP server %s\n", SpoolFile); exit(1); }; }; f=fdopen(fd, "r+"); fgets(buf, 127, f); fflush(f); fprintf(f, "a001 LOGIN %s \"%s\"\r\n", Username, Password); fflush(f); fgets(buf, 127, f); if(buf[5]!='O') { /* Looking for "a001 OK" */ fprintf(stderr, "Server doesn't like your name and/or password!\n"); fprintf(f, "a002 LOGOUT\r\n"); fclose(f); return NULL; }; return f; } int count_mail_pop() { FILE *f; char buf[256]; int total,read; f = pop_login(); if(f==NULL) return -1; fflush(f); fprintf(f,"STAT\r\n"); fflush(f); fgets(buf,256,f); sscanf(buf,"+OK %d",&total); fflush(f); fprintf(f,"LAST\r\n"); fflush(f); fgets(buf,256,f); sscanf(buf,"+OK %d",&read); Number=total-read; fprintf(f,"QUIT\r\n"); fclose(f); return 1; } struct msg { int size; int read; }; struct msg *get_list(FILE *f,int *nout) { char buf[256]; struct msg *l; int i,n; fflush(f); fprintf(f,"STAT\r\n"); fflush(f); fgets(buf,256,f); sscanf(buf,"+OK %d",&n); l=malloc(sizeof(struct msg)*n); fflush(f); fprintf(f,"LIST\r\n"); fflush(f); fgets(buf,256,f); if(strncmp(buf,"+OK",3)) { fprintf(stderr,"Can't get list?\n"); return NULL; }; for(i=0;iread=0; for(;;) { fgets(buf,256,f); if(!strcmp(buf,".\r\n")) break; if(!strncmp(buf,"Status: R",9)) l->read=1; }; /* fprintf(stderr,"msg %d %s\n",i+1,l->read?"read":"unread"); */ } int count_mail_pop_2() { FILE *f; int i,j,n2; int total=0; static struct msg *l1=NULL,*l2; static int n; f = pop_login(); if(f==NULL) return -1; if(l1==NULL) { /* get initial list */ l1=get_list(f,&n); if(l1==NULL) return -1; for(i=0;id_name[0] != '.') Number++; } closedir(dir); } return 1; } int count_mail() { if(Options&USE_MAILDIR) { return count_mail_maildir(); #ifdef POP3 } else if(Options&USE_APOP3) { return count_mail_pop_2(); } else if(Options&USE_POP3) { return count_mail_pop(); } else if(Options&USE_IMAP) { return count_mail_imap(); #endif } else { return count_mail_mbox(); } } xlassie-1.8/todo100644 764 144 132 7037440146 12524 0ustar xyzzyusers1. write man page 2. use X resources 3. #ifdef shape stuff 4. use gnome dock app protocol xlassie-1.8/socket.c100644 764 144 3101 6766622030 13311 0ustar xyzzyusers/* Copyright (C) 1998 Trent Piepho * (C) 1999 Trent Piepho * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include #include #include #include #include "defaults.h" #ifdef POP3 int sock_connect(char *hostname,int port) { struct hostent *host; struct sockaddr_in addr; int fd,i; host=gethostbyname(hostname); if(host==NULL) { herror("gethostbyname"); return(-1); }; fd=socket(PF_INET,SOCK_STREAM,IPPROTO_TCP); if(fd==-1) { perror("Error opening socket"); return(-1); }; addr.sin_family=AF_INET; addr.sin_addr.s_addr=*(u_long *)host->h_addr_list[0]; addr.sin_port=htons(port); i=connect(fd,(struct sockaddr *)&addr,sizeof(struct sockaddr)); if(i==-1) { perror("Error connecting"); close(fd); return(-1); }; return(fd); } #endif xlassie-1.8/xlassie.spec100644 764 144 2121 7304674677 14217 0ustar xyzzyusersSummary: Mail notification tool for X11, POP3 support, counts messages Name: xlassie Version: 1.8 Release: 1 Copyright: GPL Group: X11/Utilities Packager: Trent Piepho Source: http://www.speakeasy.org/~xyzzy/download/%{name}-%{version}.tar.gz URL: http://www.speakeasy.org/~xyzzy/xlassie/ BuildRoot: /tmp/xlassie %changelog * Fri Jan 1 1999 Trent Piepho - Made spec file %description XLassie is an enhanced version of XBiff. Support for POP3 mailservers, ability to run a command when clicked on, written in straight xlib so memory usage is less, and it doesn't just tell you _if_ you have new mail, but how many new messages you have. Extra support to operate as a KDE or WindowMaker dock applet, in addition to plain old X11 mode. %prep %setup %build make CFLAGS="$RPM_OPT_FLAGS" %install rm -rf $RPM_BUILD_ROOT install -d -m 755 $RPM_BUILD_ROOT/usr/X11R6/bin install -s -m 755 xlassie $RPM_BUILD_ROOT/usr/X11R6/bin %files %attr(-, root, root) %doc README xlassie.lsm %attr(-, root, root) /usr/X11R6/bin/xlassie %clean rm -rf $RPM_BUILD_ROOT xlassie-1.8/xlassie.lsm100644 764 144 1337 7304674550 14056 0ustar xyzzyusersBegin3 Title: XLassie Version: 1.8 Entered-date: 29MAY01 Description: XLassie is an enhanced version of XBiff. Support for POP3 or IMAP mailservers, ability to run a command when clicked on, written in straight xlib so memory usage is less, and it doesn't just tell you _if_ you have new mail, but how many new messages you have. Extra support for both KDE and WindowMaker. Keywords: mail notification biff xbiff KDE WindowMaker Author: xyzzy@speakeasy.org (Trent Piepho) Maintained-by: xyzzy@speakeasy.org (Trent Piepho) Primary-site: ftp.u.washington.edu /public/xyzzy 19kB xlassie-1.8.tar.gz Alternate-site: sunsite.unc.edu /pub/Linux/X11/xapps Platforms: X11 Copying-policy: GPL End xlassie-1.8/defaults.h100644 764 144 7064 7304415052 13642 0ustar xyzzyusers/* Default settings */ /* You can change the default colors by editing the source code, they are * near the beginning and should be pretty obvious */ /****************************************************************************/ /* Support for getting mail from a POP3 server. Use the -pop3 option to give * the server name, the -password option for the password, and the -usename * option if the usename is different than the local one. The password * argument will be overwritten so it doesn't show up in a "ps". Even if you * compile in POP3 support, it is still possible to use a local mail spool. */ #define POP3 /****************************************************************************/ /* Make offline mode the default. Offline mode is usefull if you have a * dialup connection to the internet. XLassie will display an "X" instead of * a number if it is unable to contact the POP3 server. */ /* #define OFFLINE_DEFAULT */ /****************************************************************************/ /* Interval between checks for new mail, the default is 5 seconds for a local * file and 60 seconds for a POP3 server */ #define INTERVAL_POP3 60 /* POP3 default */ #define INTERVAL_SPOOL 5 /* Spool file default */ /****************************************************************************/ /* Default command to run when the window is clicked on. The command will get * executed via system() which means you can use shell contructs. The command * should be placed in the background or xlassie will be frozen until it * completes. */ /* run pine in an xterm */ #define COMMAND "rxvt +sb -T pine -e pine &" /* start kmail */ /* #define COMMAND "kmail &" */ /* fetch mail from pop server */ /* #define COMMAND "fetchpop -r &" */ /* fetch pop mail, then run pine */ /* #define COMMAND "(fetchpop -r ; rxvt -e pine) &" */ /****************************************************************************/ /* Default font for the display. You can use xfontsel to try and find some * nice fonts on your system. I would suggest using a scalable font. */ /* Some people don't have the utopia font, but they should, it's one of the * standard fonts that come with X. */ #define FONTNAME "-*-utopia-medium-r-normal--40-*-*-*-*-*-iso8859-1" #define KDEFONT "-*-utopia-medium-r-normal--25-*-*-*-*-*-iso8859-1" #define WMFONT "-*-utopia-medium-r-normal--56-*-*-*-*-*-iso8859-1" /* These fonts will get used as back ups, in case the first font doesn't work. * They will just be tried in order, and if none of them are found, then * xlassie will fail to run. */ /* The URW helvetica scalable font, common with Linux distros as the part of * the urw-fonts or ghostscript-fonts packages */ #define FONTNAME1 "-urw-helvetica-medium-r-normal--40-*-*-*-*-*-iso8859-1" #define KDEFONT1 "-urw-helvetica-medium-r-normal--25-*-*-*-*-*-iso8859-1" #define WMFONT1 "-urw-helvetica-medium-r-normal--56-*-*-*-*-*-iso8859-1" /* The Helvetica font might also be called nimbus sans l.... */ #define FONTNAME2 "-urw-nimbus sans l-medium-r-normal--40-*-*-*-*-*-iso8859-1" #define KDEFONT2 "-urw-nimbus sans l-medium-r-normal--25-*-*-*-*-*-iso8859-1" #define WMFONT2 "-urw-nimbus sans l-medium-r-normal--56-*-*-*-*-*-iso8859-1" /* Don't have any scalable fonts? Maybe you have these bitmap fonts? */ #define FONTNAME3 "-adobe-times-medium-r-normal--34-*-*-*-*-*-iso8859-1" #define KDEFONT3 "-adobe-times-medium-r-normal--25-*-*-*-*-*-iso8859-1" #define WMFONT3 "-adobe-times-medium-r-normal--34-*-*-*-*-*-iso8859-1" /****************************************************************************/ xlassie-1.8/COPYING100444 764 144 43150 6456251246 12741 0ustar xyzzyusers---------------------------------------- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.