naruto2 / tageventor

Automatically exported from code.google.com/p/tageventor
0 stars 0 forks source link

Use D-Bus #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Using D-Bus instead of home-made scripts would make it possible to solve a
few problems with the architecture.

For example, it could:
- Solve problems with launching X applications
- Could autostart when a reader is plugged in
- Could exit when the last client exits

I wrote a D-Bus daemon for libfprint (a fingerprint reader library), which
works similarly to the tageventor daemon:
http://hadess.fedorapeople.org/fprintd/docs/

1) Solve problems with launching X applications

A small session daemon could run within the user's session, and listen to
events on the D-Bus. It would make it easy to create desktop-specific
front-ends (say, a configuration to allow setting a particular tag to start
"Play").

2) Could autostart when a reader is plugged in

Either through D-Bus, or using udev to autostart the daemon

3) Could exit when the last client exits

If the daemon starting was based on D-Bus service activation, it could exit
the last client exits, after a small timeout (say 30 seconds), or when the
last reader is unplugged/disabled.

Original issue reported on code.google.com by hadessuk@gmail.com on 27 Jun 2009 at 5:25

GoogleCodeExporter commented 8 years ago
Hi Hadessuk, sorry I didn't see your submission until now when browsing 
issues!!!
It seems I need to set-up notification e-mails for this which I hadn't done!
I really appreciate your input, thanks a lot. Here is a discussion of them:

1) Using D-Bus instead of home-made scripts

A small session daemon could run within the user's session, and listen to
events on the D-Bus. It would make it easy to create desktop-specific
front-ends (say, a configuration to allow setting a particular tag to start
"Play").

- Part of the problem that solves is avoided with the GNOME version, but it 
would be
interesting to develop the idea further. I'd like to be able to generate 
"SYSTEM"
events (login/out, shutdown, lock, openURL, etc).

- I've wanted to use a more common "system method" but am very ignorant of 
D-Bus,
G-Conf and such other things, so I'm ready to be educated or get contributors 
in that
area. 

For a work project, I need to focus more on the reading of NFC tags for a while 
which
will delay me looking at improvements in this area.

2) 
Solve problems with launching X applications
- That is not a problem with the gtagEventor GNOME version I'm now spending 
most of
my time on, as it's started with each GNOME session and executes X programs 
fine.

3)
Could autostart when a reader is plugged in
- That would be quite nice to do.

4) Could exit when the last client exits

If the daemon starting was based on D-Bus service activation, it could exit
the last client exits, after a small timeout (say 30 seconds), or when the
last reader is unplugged/disabled.

- There is no real concept of "client" at the moment, as the idea is something 
that's
always running and monitoring for tags to generate asynchronous events, so not 
so
sure on that part

- If it was activated when a read is plugged in, then deactivating when last 
reader
is unplugged seems logical and elegant.

Original comment by aute...@gmail.com on 25 Nov 2009 at 9:07