responsibility for enabling/disabling bluetooth?

Ben Liblit liblit at cs.wisc.edu
Mon Dec 31 15:04:12 PST 2007


HAL running on my ThinkPad X61 correctly detects when the special 
wireless networking key (Fn+F5) has been pressed, and broadcasts this on 
the system D-BUS:

	platform_i8042_i8042_KBD_port_logicaldev_input condition
	  ButtonPressed = forward

	signal sender=:1.5 -> dest=(null destination)
	  path=/org/freedesktop/Hal/devices/computer;
	  interface=org.freedesktop.Hal.Device;
	  member=Condition
	    string "ButtonPressed"
	    string "wifi-power"

Great!  But after that ... nothing interesting happens.  Traditionally 
this key has been used to enable/disable Bluetooth.  If I want that to 
happen now, how should I hook that up?  I already know how to write a 
small Python script that reacts to HAL ButtonPressed signals.  But this 
script would need to run as root, since normal uses cannot write to 
/proc/acpi/ibm/bluetooth.

I'm loath to create new scripts running as root.  Is that really the 
right approach here?  Or is there some other system component that 
already ought to be listening for this signal but is either buggy or not 
running?

(By the way, if I do enable/disable Bluetooth by writing to 
/proc/acpi/ibm/bluetooth, everything else works perfectly.  The bluez 
GNOME Bluetooth applet appears/disappears correctly, for example. 
Hooray!  Go HAL!)


More information about the hal mailing list