[maemo-developers] [maemo-developers] Waiting for DBUS events in shell scripts
From: Stefan Tomanek stefan at pico.ruhr.deDate: Fri Mar 24 02:19:45 EET 2006
- Previous message: [maemo-developers] Hooking into network configuration
- Next message: [Fwd: Re: [maemo-developers] J2ME on Nokia 770]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
During my experiments with DBUS (see my other message) I tried to react to
DBUS signals through shell scripts; However, I encountered a strange problem:
I tried to parse the output of "dbus-monitor --system", which should be no
problem with sh, grep or awk. But there is an issue regarding the buffering of
its output pipe. What I tried to code boiles down to the following lines:
dbus-monitor --system | while read LINE; do <something with $LINE>; done
However, nothing happens. I noticed that no lines are passed through the pipe,
which can be checked by this command:
dbus-monitor --system | cat -
Instead of printing dbus events to console, nothing happens. I guess that this
might be a buffering issue with busybox or dbus-monitor, however these
commands work fine on the Debian system installed on my notebook.
What would be even cooler than this would be a dbus-signal-wait command, which
just sleeps until a specified events occurs; This way, a shell script waiting
for internet connectivity could just be implemented by writing:
while dbus-signal-wait -i com.nokia.......; do
use_connection
done
OK, any comments regarding my ideas? :-)
--
.:°stefan at pico.ruhr.de | tommie at IRC | GPG: finger stefan at localhost.ruhr.de °:.
|_____________________ http://stefans.datenbruch.de/__ ______________________|
| Wer Header fälscht oder verfälscht oder gefälschte oder verfälschte Header |
`-__in_Umlauf_bringt_wird_mit_Scorefile_nicht_unter_-500_Punkten_bestraft__-'
- Previous message: [maemo-developers] Hooking into network configuration
- Next message: [Fwd: Re: [maemo-developers] J2ME on Nokia 770]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
