[ltp] udev rule and bluetooth

Torsten Wolf linux-thinkpad@linux-thinkpad.org
Wed, 2 Aug 2006 09:58:10 +0200


* Thomas Breitner <mail@tombreit.de> [06-08-02 09:43]:

>does anyone have some working udev-rules for the fn+f5-bluetooth-switch?
[...]
>any ideas about some thinkpad-udev-rules for someone who dislike binding
>this action to/on(?) ibm_acpi?

What's wrong with ibm-acpi? I simply added a file containing

  event=ibm/hotkey HKEY 00000080 00001005
  action=/usr/local/bin/toggle_bluetooth.sh

to /etc/acpi/events with all the scripts in toggle_bluetooth.sh. The
state of the bluetooth device can be determined as follows:

  STATUS=`grep "status:" /proc/acpi/ibm/bluetooth | awk '{print $2}'`

Certainly the above line is not very elegant but on the whole it works
without problems.

Cheers,
Torsten