This script automates the common troubleshooting steps required to establish a stable and functional Bluetooth stack on an Arch Linux system, particularly when using the Hyprland Wayland compositor and the PipeWire audio backend.
It resolves typical conflicts (like residual PulseAudio Bluetooth packages) and ensures all necessary services and packages are installed and correctly configured for Bluetooth audio (A2DP/HSP/HFP) via PipeWire.
- Operating System: Arch Linux or an Arch-based distribution.
- User Permissions: The script must be run with root privileges (
sudo). - Audio Backend: This script is designed for systems using PipeWire for audio management.
- Save the Script: Save the content of the script as
fixblue.sh. - Make Executable: Grant execution permissions to the script:
chmod +x fixblue.sh
- Run the Fix: Execute the script using
sudo:sudo ./fixblue.sh
The fixblue.sh script performs the following actions:
- Prerequisite Check: Verifies that the script is run as root and that
pacmanis available. - Conflict Cleanup:
- Removes the potentially conflicting package
pulseaudio-bluetooth. - Clears old pairing data from
/var/lib/bluetoothto allow for fresh device pairing.
- Removes the potentially conflicting package
- Package Installation: Installs or updates the following essential packages:
bluezandbluez-utils(The core Bluetooth stack and utilities likebluetoothctl).pipewire,pipewire-pulse, andwireplumber(The complete PipeWire audio stack).blueman(A common graphical Bluetooth manager suitable for Hyprland).linux-firmware(To ensure the latest Bluetooth device firmware is present).
- Service Management:
- Checks and unblocks Bluetooth devices using
rfkill. - Enables and starts the system service
bluetooth.service.
- Checks and unblocks Bluetooth devices using
- PipeWire Configuration: Enables and starts the necessary user services for PipeWire integration, including
pipewire-pulse.serviceandwireplumber.service.
For all service changes to be fully applied to your user session, a reboot is required.
- Reboot:
reboot
- Connect Devices: After logging back into Hyprland, you can manage your Bluetooth devices using the graphical utility:
Alternatively, you can use the command-line tool
blueman-manager
bluetoothctl.