[Gllug] Dbus/Hal - doing useful things

Tethys sta296 at astradyne.co.uk
Thu Oct 20 12:06:03 UTC 2005


Huw Lynes writes:

>What I want to do is run a program when a particular device gets
>attached. I could write a python app (the dbus python bindings don't
>look that hard) and get Gnome to autostart it. Then it can listen to
>Dbus and do it's stuff when it sees the device get attached.

No need to look for dbus events yourself. Hotplug's usb agent already
runs whenever a new USB device is attached. You could almost certainly
convince it to run your script for you when your device is attached.

It may be a simple as just plonking it in /etc/hotplug/usb along with
a suitable usermap file. It's one of those things I've been meaning to
look into for a while, but never got past a cursory glance at it...

Tet
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list