I'd like to use a simple Perl script to make some configurations every time I connect e.g. my bluetooth headset. I tried using Net::DBus, but my OS/DE (Fedora 17, GNOME3) doesn't use HAL anymore.
I really don't want to install HAL just for this, so what do I do? My ideas so far:
- (Preferred): Use DBus; simply listen to UDev events instead of
org.freedesktop.Hal
. Problem: I cannot find the corresponding service,org.freedesktop.UDisks
only seems to monitor disks (duh). Does UDev even send DBus messages for other devices and if not, can I configure it to do so? - Use an UDev rule to trigger another script. I like to have my scripts in one place for easy transition to new OS installs, so I'd rather avoid that.
- Am I better off just using Python to listen directly to UDev?
- Or can I use Perl to do just that? A CPAN search for "udev" didn't yield anything helpful.
Or I may be completely off and UDev isn't even what I need. Neither the docs nor Google were really helpful regarding that matter. A workaround would be if anyone knows how to get GNOME3 to switch audio output to a newly connected bluetooth headset per default, but I'd like to learn scripting stuff like that anyway.
Thanks in advance for any pointers!
A.
PS: By the way, Google&Co. claim that UDev gets the devices and sends a message to HAL, which in turn notifies DBus. That is most definitely not the case since HAL isn't even in the Fedora Repos aymore.