Script for toggling bluetooth

From ThinkWiki
Jump to: navigation, search

The following code snipped may be useful to enable/disable bluetooth functionality on a thinkpad.

#!/bin/bash
INFO=/proc/acpi/ibm/bluetooth
STATE=`cat $INFO | grep status| awk '{print $2}'`
case "$STATE" in
       enabled)
       echo -n "disable" > $INFO
;;
       disabled)
       echo "enable" -n > $INFO
;;
       *)
       echo "usage: disable, enable"
esac

Further extensions

Using Windows the Fn-F5 buttons allows to switch on/off WLAN and bluetooth also. In the future the following features will be added

  • include WLAN in switching
  • show status on screen