[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Good news on claws-mail



Steve Litt <slitt@troubleshooters.com> writes:

> Those visual and audio hints are one of the few things that most
> programs might need to write to. They need a predefined standard to
> write to, and I guess dbus is the standard being used. If I were in
> charge of standards, I might have used something simpler (like a fifo
> with a very simple data definition) exclusively for notifications (the
> official visual and audio hints), but hey, that's just me.

Does dbus work over the network?  People might want to be informed on
their cell phone or on another computer when a new email arrives at the
MUA they have running on their computer, or when a job they started has
completed.

If I was using these info things, I might want to be informed on the
same computer when a compile job has completed, and 'make' should have
a command line option for this ;)


Since you're re-inventing the wheel:


// sxnotify.c
//
// 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 3 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, see
// <http://www.gnu.org/licenses/>.
//
// Author: lee@yun.yagibdah.de, 2013-07-21
//
// compile with something like:
// gcc -lsx -lXpm -lXaw -lXt -lX11 -march=native -O2 -Wall -fomit-frame-pointer -finline-functions sxnotify.c -o sxnotify
//


#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

#include <libsx.h>


void xx(void *data)
{
	exit(0);
}


int main(int argc, char *argv[]) {

	if(!OpenDisplay(argc, argv)) {
		puts("cannot open display");
		exit(1);
	}

	if(argc != 2) {
		puts("usage: sxnotify message");
		exit(1);
	}

	MakeLabel(argv[1]);
	ShowDisplay();
	int foo;
	AddTimeOut(5000, xx, (void *)(&foo));
	MainLoop();
	exit(0);
}

# aptitude install libsx-dev


-- 
Again we must be afraid of speaking of daemons for fear that daemons
might swallow us.  Finally, this fear has become reasonable.

Reply to: