Files
lenovo-gentoo/scripts/bluetooth-setup/README.md
Alexander Hinrichs 8de3f16ee6 chore: initialize gentoo-setup documentation repository
Add comprehensive documentation for Lenovo ThinkPad Gentoo Linux setup
including:
- Complete system configuration guides (power, Bluetooth, WiFi, audio)
- Hardware setup documentation (touchpad, touchscreen, DisplayLink)
- Management scripts with ZSH completions
- Kernel configuration (6.12.41-gentoo-x86_64)
- Lid automation and monitor management
- Battery conservation system
- User guides and troubleshooting

Repository includes .gitignore to exclude logs, temporary files, and
secrets.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 18:22:51 +01:00

161 lines
3.2 KiB
Markdown

# Bluetooth Setup Tool
Easy Bluetooth device management for Gentoo using `bluetoothctl`.
## Features
- 🔍 Scan for nearby Bluetooth devices
- 🔗 Pair and connect to devices
- 📋 List paired devices with connection status
- ❌ Remove/forget devices
- 🔌 Enable/disable Bluetooth
- ✨ Color-coded output for better readability
- ⚡ ZSH autocompletion support
## Installation
```bash
# From the scripts folder
cd scripts/bluetooth-setup
# Install the main script
sudo cp bluetooth-setup /usr/local/bin/bluetooth-setup
sudo chmod +x /usr/local/bin/bluetooth-setup
# Install ZSH autocompletion
sudo mkdir -p /usr/local/share/zsh/site-functions
sudo cp _bluetooth-setup /usr/local/share/zsh/site-functions/_bluetooth-setup
# Reload ZSH completions (or restart your shell)
autoload -U compinit && compinit
```
## Requirements
- `bluetoothctl` (from bluez package)
- Bluetooth service running (`rc-service bluetooth start`)
- Bluetooth hardware not blocked (`rfkill list bluetooth`)
## Usage
### List paired devices
```bash
bluetooth-setup
# or
bluetooth-setup list-paired
```
### Scan for nearby devices
```bash
bluetooth-setup scan
```
### Pair with a device
```bash
bluetooth-setup pair AA:BB:CC:DD:EE:FF
```
The script will automatically trust the device after pairing and ask if you want to connect.
### Connect to a paired device
```bash
bluetooth-setup connect AA:BB:CC:DD:EE:FF
```
### Disconnect from device(s)
```bash
# Disconnect all devices
bluetooth-setup disconnect
# Disconnect specific device
bluetooth-setup disconnect AA:BB:CC:DD:EE:FF
```
### Remove/forget a device
```bash
bluetooth-setup remove AA:BB:CC:DD:EE:FF
```
### Show Bluetooth status
```bash
bluetooth-setup status
```
### Enable/disable Bluetooth
```bash
bluetooth-setup power on
bluetooth-setup power off
```
### Get help
```bash
bluetooth-setup help
```
## ZSH Autocompletion
Once installed, ZSH will provide intelligent completions:
- Command completion: `bluetooth-setup <TAB>`
- Device completion: `bluetooth-setup connect <TAB>` shows paired devices
- Power state completion: `bluetooth-setup power <TAB>` shows on/off
## Troubleshooting
### Bluetooth service not running
```bash
sudo rc-service bluetooth start
sudo rc-update add bluetooth default
```
### Bluetooth is blocked
```bash
# Check status
rfkill list bluetooth
# Unblock
sudo rfkill unblock bluetooth
```
### Device won't pair
1. Make sure the device is in pairing mode
2. Ensure Bluetooth is powered on: `bluetooth-setup power on`
3. Remove the device if previously paired: `bluetooth-setup remove MAC`
4. Try pairing again
### Can't find bluetoothctl
```bash
# Install bluez
sudo emerge -av net-wireless/bluez
```
## Examples
### Connect to Bluetooth headphones
```bash
# Enable Bluetooth
bluetooth-setup power on
# Scan for devices
bluetooth-setup scan
# Pair and connect (use MAC address from scan)
bluetooth-setup pair AA:BB:CC:DD:EE:FF
# Later, reconnect quickly
bluetooth-setup connect AA:BB:CC:DD:EE:FF
```
### Quick disconnect
```bash
# Disconnect all Bluetooth devices
bluetooth-setup disconnect
```
## Integration with Waybar
The Bluetooth status can be displayed in waybar. See the main project documentation for waybar configuration.
## Related
- WiFi Setup: See `scripts/wifi-setup/` for WiFi management