Adds the Chinese Bluetooth Lady voice for connecting and disconnecting Bluetooth devices on Linux.
sudo apt install libsox-fmt-mp3 bluetoothctl
Note
Other distributions, such as Arch and Fedora are not yet officially supported.
Clone the repository to your local machine:
git clone https://github.com/Pahheb/chinese-bluetooth-lady
Enter the directory:
cd chinese-bluetooth-lady
Run the shell file:
- Option 1:
chinese_bluetooth_lady.sh
- Option 2 (If bash is not your default shell):
sh chinese_bluetooth_lady.sh
Note
The following options were interpreted from Baeldung.
You must edit the crontab file by firstly writing this:
crontab -e
And then adding the following line, where /path/to/chinese_bluetooth_lady.sh
represents the location of the script:
@reboot sh /path/to/chinese_bluetooth_lady.sh
You must append the following line to rc.local, which already runs at every bootup by editing:
/etc/rc.d/rc.local
And adding the following line, where /path/to/chinese_bluetooth_lady.sh
represents the location of the script:
sh /path/to/chinese_bluetooth_lady.sh
And then, make sure that the rc.local file is executable for it to work:
chmod +x /etc/rc.d/rc.local
You must create a chinese_bluetooth_lady.service
file under /etc/systemd/system with the following content, where /path/to/chinese_bluetooth_lady.sh
represents the location of the script:
[Unit]
Description=Reboot message systemd service.
[Service]
Type=simple
ExecStart=/bin/bash /path/to/chinese_bluetooth_lady.sh
[Install]
WantedBy=multi-user.target
And then enable it with the following commands:
chmod 644 /etc/systemd/system/chinese_bluetooth_lady.service
systemctl enable chinese_bluetooth_lady.service
To make "The Bluetooth device is ready to pair" sound play at initial PC bootup, uncomment the following command on line 22:
The checking interval of the connected bluetooth device is set to 3 seconds by default, which results in a slight delay of the sound being played when a device is paired/disconnected.
This interval can be adjusted on line 44 to be quicker (higher CPU usage), or slower (higher delay):