Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ pybmap.known_devices() # full catalog
- **Bluetooth** enabled in System Settings
- **Bose headphones** paired/connected via System Settings

### Installation (macOS & Linux Python CLI)
### Installation (Python CLI)

Run the included installer to set up dependencies (such as PyObjC on macOS) and symlink `bosectl` globally:
Run the installer for your platform. It checks prerequisites (PyObjC on macOS, a Bluetooth-capable Python on Linux) and symlinks `bosectl` into `/usr/local/bin`:

```bash
git clone https://github.com/aaronsb/bosectl.git
cd bosectl
./macOS_install.sh
./linux_install.sh # or ./macOS_install.sh
```

### From Release Binaries (Linux)
Expand Down
50 changes: 50 additions & 0 deletions linux_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
# bosectl Linux Installer
#
# pybmap uses only the Python standard library on Linux, so there is
# nothing to pip install: this checks the prerequisites and symlinks the
# repo's bosectl script onto PATH.

set -e
cd "$(dirname "$0")"

echo "=== bosectl Linux Installer ==="
echo ""

# 1. Python with Bluetooth socket support
if ! command -v python3 >/dev/null; then
echo "python3 not found. Install Python 3 with your package manager first."
exit 1
fi
if ! python3 -c 'import socket; socket.AF_BLUETOOTH; socket.BTPROTO_RFCOMM' 2>/dev/null; then
echo "This python3 was built without Bluetooth socket support (AF_BLUETOOTH)."
echo "Use your distribution's python3 package rather than a custom build."
exit 1
fi

# 2. BlueZ, for pairing
if ! command -v bluetoothctl >/dev/null; then
echo "Warning: bluetoothctl not found. Install BlueZ (package 'bluez') to pair headphones."
fi

# 3. Make bosectl script executable
echo "Configuring executable permissions..."
chmod +x bosectl

# 4. Create symlink in /usr/local/bin
echo ""
echo "To make 'bosectl' accessible from anywhere on your system,"
echo "we will create a symlink in /usr/local/bin/bosectl."
echo "This requires administrator privileges."
echo ""

if sudo ln -sf "$(pwd)/bosectl" /usr/local/bin/bosectl; then
echo ""
echo "=== Installation Successful! ==="
echo "Pair your headphones with bluetoothctl, then run 'bosectl status'."
else
echo ""
echo "=== Symlink Failed ==="
echo "Could not create symlink in /usr/local/bin."
echo "You can still run it locally using: $(pwd)/bosectl"
fi
Loading
Loading