Hello!
I'm sorry for the long wait, but I just haven't had a chance to do any programming lately, but now I'm back at it again.
I really appreciate your link to DBus, and I've chosen to go the Python way (at least for a first try, as the DBus API for Python seems to be the most well documented, and the best for beginners).
Right now my only problem is that my program seem to exit immediately after I execute it.
This is what I did:
First I just did a "sudo apt-get install ..." on the following packages:
*python-dbus
*python-wxgtk2.8
*python-wxglade
*d-feet
And they all seem to "install" correctly.
The sourcecode is as follows:
import dbus
from dbus.mainloop.glib import DBusGMainLoop
dbus_loop = DBusGMainLoop()
bus = dbus.SystemBus(mainloop=dbus_loop)
def device_added_callback(udi):
print "added"
def device_removed_callback(udi):
print "removed"
bus.add_signal_receiver(device_added_callback,
"DeviceAdded",
"org.freedesktop.Hal.Manager",
"org.freedesktop.Hal",
"/org/freedesktop/Hal/Manager")
bus.add_signal_receiver(device_removed_callback,
"DeviceRemoved",
"org.freedesktop.Hal.Manager",
"org.freedesktop.Hal",
"/org/freedesktop/Hal/Manager")
When I save it and go: "python main.py" in the Terminal, the program terminate like 1 second after I press enter.
It's probably something with the code, or so I hope, so it's a little easier to get out of :).
Best regards,
Benjamin.