Skip to content

Powerful command-line tool for managing Bluetooth audio devices on Linux

License

Notifications You must be signed in to change notification settings

web3dozie/btaudio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

btaudio ๐ŸŽง

A powerful and intuitive command-line tool for managing Bluetooth audio devices on Linux systems. Built with love by web3dozie for the Linux audio community.

Version License Shell Platform

โœจ Features

Core Functionality

  • ๐Ÿ” Smart Device Discovery - List all paired Bluetooth devices with rich status information
  • ๐Ÿ”— Intelligent Connection Management - Connect by name, alias, or fuzzy matching
  • ๐ŸŽš๏ธ Advanced Volume Control - Set, adjust, mute, boost with precision
  • ๐ŸŽฏ Device Aliases - Create shortcuts for your favorite devices
  • ๐Ÿ“Š Beautiful Status Display - Dynamic, perfectly aligned status dashboard
  • ๐ŸŽจ Interactive Mode - User-friendly TUI for non-technical users

Advanced Features

  • ๐ŸŽค Microphone Management - Full control over input devices
  • ๐ŸŽต Volume Presets - Save and load custom volume profiles
  • โš–๏ธ Balance Control - Adjust left/right audio balance
  • ๐Ÿ”„ Auto-Connect - Automatically connect to preferred devices
  • ๐Ÿ”ง Troubleshooting Mode - Built-in diagnostics with solutions
  • ๐ŸŒˆ Smart Color Detection - Works perfectly in kitty, xterm, and modern terminals

๐Ÿ“ฆ Installation

Quick Install

# Clone the repository
git clone https://github.com/web3dozie/btaudio.git
cd btaudio

# Install to ~/.local/bin
./install.sh

# Or manually
install -Dm755 bin/btaudio ~/.local/bin/btaudio

System-wide Install

sudo install -Dm755 bin/btaudio /usr/local/bin/btaudio

Dependencies

Required:

  • bluetoothctl - Bluetooth device control
  • wpctl (PipeWire) or pactl (PulseAudio) - Audio management

Optional:

  • speaker-test - Audio testing functionality
  • arecord / aplay - Microphone testing

๐Ÿš€ Quick Start

Basic Usage

# Launch interactive mode
btaudio

# List all devices
btaudio list

# Connect to a device
btaudio connect "WH-1000XM6"
btaudio sony              # Using alias
btaudio wh                # Fuzzy matching

# Volume control
btaudio volume 70         # Set to 70%
btaudio volume +10        # Increase by 10%
btaudio volume -10        # Decrease by 10%
btaudio mute              # Toggle mute
btaudio max               # Set to 100%
btaudio boost             # Set to 150% (with warning)

# Check status
btaudio status

Microphone Control

btaudio mic 80            # Set mic volume to 80%
btaudio mic mute          # Mute microphone
btaudio mic unmute        # Unmute microphone
btaudio mic +10           # Increase mic volume

Volume Presets

btaudio preset save work 30     # Save preset at 30%
btaudio preset save music 70    # Save preset at 70%
btaudio preset work             # Load work preset
btaudio preset music            # Load music preset

Auto-Connect

btaudio auto on                 # Enable auto-connect
btaudio auto add "WH-1000XM6"   # Add device to auto list
btaudio auto off                # Disable auto-connect

Troubleshooting

btaudio fix                     # Run diagnostics

โš™๏ธ Configuration

Configuration file: ~/.config/btaudio/config.yaml

Example Configuration

# Default settings
volume_step: 10
auto_connect: true

# Device: Sony WH-1000XM6
name: WH-1000XM6
alias: sony
default_volume: 80

# Device: JBL Flip 5
name: JBL Flip 5
alias: speaker
default_volume: 60

# Volume presets
preset_work: 30
preset_music: 70
preset_quiet: 20

# Auto-connect devices
auto_device: WH-1000XM6
auto_device: JBL Flip 5

๐Ÿ“Š Status Display

The status command shows a beautifully formatted, dynamically sized box:

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Audio Status โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Output โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
โ”‚ Device: WH-1000XM6             โ”‚
โ”‚ Volume: 80%                    โ”‚
โ”‚ Battery: 69%                   โ”‚
โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Input โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
โ”‚ Device: WH-1000XM6             โ”‚
โ”‚ Volume: 100%                   โ”‚
โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ System โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
โ”‚ Backend: wpctl                 โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

๐ŸŽจ Interactive Mode

Run btaudio without arguments to enter the interactive dashboard:

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚       ๐ŸŽต Audio Control          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Current: WH-1000XM6 (80%)       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ [1] ๐Ÿ“ฑ Connect Device           โ”‚
โ”‚ [2] ๐Ÿ”Š Volume Control           โ”‚
โ”‚ [3] ๐Ÿ”„ Switch Output            โ”‚
โ”‚ [4] ๐ŸŽค Toggle Mic Mute          โ”‚
โ”‚ [5] โš™๏ธ  Show Status              โ”‚
โ”‚ [6] โŒ Disconnect All           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ [Q] Quit                        โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

๐Ÿ› ๏ธ Advanced Usage

Balance Control

btaudio balance left 20     # Shift 20% to left
btaudio balance right 10    # Shift 10% to right
btaudio balance center       # Reset to center

Audio Testing

btaudio test                 # Test stereo
btaudio test left           # Test left channel
btaudio test right          # Test right channel
btaudio test mic            # Test microphone

Device Switching

btaudio switch speaker      # Disconnect others, connect speaker
btaudio disconnect          # Disconnect current device
btaudio -                   # Quick disconnect

๐Ÿ—๏ธ Architecture

btaudio is built with:

  • Pure Bash - No external language dependencies
  • Modular Design - Clean function separation
  • Smart Detection - Automatic audio system detection (PipeWire/PulseAudio)
  • Error Handling - Comprehensive error checking with helpful messages
  • Color Support - Intelligent terminal capability detection

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built with passion by web3dozie
  • Inspired by the Linux audio community's needs
  • Special thanks to all contributors and testers

๐Ÿ› Troubleshooting

Common Issues

No devices found

  • Ensure Bluetooth service is running: systemctl status bluetooth
  • Pair devices first: bluetoothctl scan on

Volume controls not working

  • Check if PipeWire is running: systemctl --user status pipewire
  • Try PulseAudio fallback: pactl list sinks

Colors not displaying

  • btaudio auto-detects terminal capabilities
  • Force disable with: NO_COLOR=1 btaudio

Mic not switching

  • Ensure default source is set correctly
  • Use btaudio fix for diagnostics

๐Ÿ“š Documentation

๐Ÿ”„ Changelog

v0.1.0 (September 2025)

  • Initial release by web3dozie
  • Core Bluetooth audio management
  • Interactive mode
  • Volume presets and auto-connect
  • Microphone management
  • Balance control (PipeWire)
  • Troubleshooting mode
  • Dynamic status display

Made with โค๏ธ by web3dozie

About

Powerful command-line tool for managing Bluetooth audio devices on Linux

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages