TIP_bluetooth_headset_daemon_and_init_script
Introduction
This TIP is here to bring you an init script starting btsco (or btsco2) and let you use your bluetooth headset. Cause btsco will exit if your headset is not switched on when the init script starts, there is a bash script that will act as a daemon, waiting for your headset to be switched on and then automatically start btsco.
If you want to use btsco2 this is not necessary, cause it will keep running even if your headset is switched of. In this case you only need the init script.
Requirements
In order to use this you will need alsa, bluetooth and your headset to be properly configured.
Please follow these documentations to reach this:
- The Gentoo Linux ALSA Guide [1]
- The Gentoo Linux Bluetooth Guide [2]
- HOWTO use a bluetooth headset Bluetooth headset
Installation
Headset daemon
Note: This is not necessary if you are going to use btsco2.
First we will get the bash script that will act as a daemon waiting for the headset being switched on.
Just copy/paste this file as root:
| jane ~# | vi /usr/local/bin/connect-to-headset.sh  |
|
| File: /usr/local/bin/connect-to-headset.sh |
|
Now make the script executable:
| jane ~# | chmod +x /usr/local/bin/connect-to-headset.sh  |
|
Note: For this script to work you will also need the config file created later.
Init script
Second we need the init script that lauches btsco(2) (and the just created script):
| jane ~# | vi /etc/init.d/headset  |
|
| File: /etc/init.d/headset |
|
Now make the init script executable:
| jane ~# | chmod +x /etc/init.d/headset  |
|
In addition, the init script and the daemon script, both require a config file. This file should provide the hardware address of your headset. Btsco will only be started for devices using this address. Please follow the headset guide Bluetooth headset#Configure the system if you haven't yet. You can also choose whether you want to use btsco or btsco2.
| jane ~# | vi /etc/conf.d/headset  |
|
| File: /etc/conf.d/headset |
|
Usage
That's all we need for now :)
If you want the init script to be started with your system (*very* recommended). Please type:
| jane ~# | rc-update add headset default  |
|
To start it right now, just type:
| jane ~# | /etc/init.d/headset start  |
|
... and switch on your headset. After a few seconds you will be able to use it.
Note: Sometimes my headset needs some time to calm down before I can use it. (Maybe yours too; so please be patient)
Last modified: Fri, 05 Sep 2008 15:29:00 +1000 Hits: 7,497
Created by NickStallman.net, Luxury Homes Australia
Real estate agents should be using interactive floor plans and list their apartments, townhouses and units.