using dbus to prevent the users from enabling a laptop microphone

Kent Baxley kb4xley at gmail.com
Fri May 8 11:04:29 PDT 2009


I'm researching a possible solution to disable the internal microphone on
laptops running Red Hat Enterprise Linux 5.3. For now we will assume
RHEL5/ALSA and
the Gnome desktop are being used. Turning off the microphone is the easy
part....we can script in:amixer sset 'Capture' 0%,0% mute nocap

...at system startup, which will disable the microphone from being used to
capture sound.

The user, however, has control over the mixer channels and can simply
override this with a simple mouse click on the appropriate channel using the
Gnome Volume
Control.

The end goal would be  to monitor this mouse click, and if the microphone is
enabled, issue a popup message warning the user of the potential
foolishness of their actions.  The answer looks like it lies in using dbus
(and possibly HAL) but I haven't found an API for the Volume
Control/dbus in Gnome  Python would be the prefereable way to code this via
the python-dbus module. Something like this:
#!/usr/bin/env python
import dbus
system_bus  = dbus.SystemBus()
eth0 = system_bus.get_object('org.freedesktop.NetworkManager',
'/org/freedesktop/NetworkManager/Devices/eth0')
blah, blah, blah...

The details on how to possibly do this for the microphone / Volume Control,
however,  have so far been pretty elusive.

Is this doable via dbus, and, if it is, are there any hints available that
might get us a bit further along?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20090508/c90369f2/attachment.html 


More information about the dbus mailing list