pacmax beta

Alfred Pac by vegardinho on GitHub

bluetooth controller

Alfred workflow for managing bluetooth settings and -connections

From their README

Alfred Workflow: Bluetooth Controller

A powerful toolkit for managing your bluetooth connections. Includes Remote Trigger, to manage your Bluetooth devices on the big screen.

Contents


Installation

  1. Download the Alfred workflow and double-click to install.
  2. Install blueutil:
  • Using package manager Homebrew:

    # install
    brew install blueutil
    
    # update
    brew update
    brew upgrade blueutil
    
    # uninstall
    brew remove blueutil
    
  • Using package manager MacPorts:

    # install
    port install blueutil
    
    # update
    port selfupdate
    port upgrade blueutil
    
    # uninstall
    port uninstall blueutil
    
  1. Allow Alfred to control bluetooth.
  2. Enjoy!

Please see troubleshooting section if you experience any issues, and post an issue if the problem persists. Description of commands can be found below.


Usage

Commands

Manage bluetooth status

  • Turn bluetooth on: bton
  • Turn bluetooth off: btoff
  • Toggle bluetooth status: bttoggle
  • Reset (disable, wait 1.5 seconds, enable: btreset

Toggle Device Connections

  • Connect/disconnect from device: btd + device name

Manage favorite device

  • Set favorite device: btsetfavorite + device name
  • Toggle connection with favorite device:
    • with hotkey: cmd-ctr-option-f
    • with keyword: btfavorite
  • Remove device as favorite:
    • btd + device name + press modifier key shift
    • btsetfavorite + device name + press modifier key shift

Pair/Unpair Device

  • Pair:
    • btp + device name
    • Wait 5 seconds for results to show up.
  • Unpair:
    • btd + device name + press modifier key cmd

Large-Type Bluetooth Status

  • See status of bluetooth connection and paired devices.
  • btstatus

Safe Mode

Set workflow configuration variable confirm in workflow to true if you want to force user confirmation on toggle and deactivation commands. (Useful for iMacs and Mac Minis who that would have trouble turning Bluetooth on again without any input devices.)

Remote triggers

Most, or all, the listed commands have their own Remote Trigger. (You're welcome to add ones that are missing.)


Troubleshooting

Notifications not working, or notificator error

Have you granted Alfred access to controlling bluetooth? If you still experience issues after granting access, these problems probably stems from the notificator binary being blocked by Gatekeeper. We therefore need to allow it to run (remove the quarantine attribute from the bundled binary):

  1. Open workflow folder in Finder by right clicking workflow (see image).
  2. Right-click on notificator and click 'open' (see image).
  3. Confirm open when dialog appears.
  4. This can alternatively be done using the terminal.

Error xcrun: error: invalid active developer path

If you experience the error xcrun: error: invalid active developer path, Command Line Tools is likely not installed properly. More info, as well as instructions on how to install it, can be found here: https://apple.stackexchange.com/a/254381

Remove quarantine using terminal

Use the following command once in directory:

  • Notificator: xattr -d com.apple.quarantine ./notificator How to open directory in Terminal

Allow Alfred to control bluetooth

Go to System Preferences -> Privacy & Security -> Bluetooth and add the Alfred version you are using (e.g., Alfred 5). If you have already added Alfred, ensure it is turned on. Allow bluetooth in System Preferences

Why do I need to install blueutil with Homebrew?

Many users with silicon chip macs experienced issues with the local binaries provided in the workflow. It also required manual removal of quarantine for many users, and relied on workflow updates for every new release of blueutil. After the implementation of Alfred's new [Resolve Dependecies feature], use of Homebrew installed tools suddenly became a lot more user friendly. I decided the time had come for letting Homebrew manage blueutil.


Installation images

(Note: in the second image, the binary should be notificator, not blueutil.) "How to open directory in Finder" How to open binary file


Screenshots

Screenshot of all options Screenshot of device toggle


Attribution

  • blueutil binary is used for bluetooth functionality.
  • notificator binary is used for notifications.

Latest release

  • 4.2.21 year ago, 4.4 MBDownload

    NEW IN THIS EDITION:

    • Fix remote connect favorite command.
19 earlier releases
  • 4.2.11 year ago, 4.4 MBDownload

    NEW IN THIS EDITION:

    • Fixes bug in 4.2 that causes constant updates. Closes #43.
  • 4.22 years ago, 4.4 MBDownload

    NEW IN THIS EDITION:

    • Workflow now uses Homebrew-installed blueutil instead of binary in workflow directory. Closes #35.

    IMPORTANT: this requires existing users to install blueutil with Homebrew, either manually, or thorugh Alfred's new Resolve Depependencies feature. Please see troubleshooting section and installation instructions in README for more information.

  • 4.12 years ago, 4.4 MBDownload

    NEW IN THIS EDITION:

    • Environment variable 'confirm' is now set by workflow user configuration. Closes #39.
  • 4.03 years ago, 4.2 MBDownload

    NEW IN THIS EDITION:

    • Reorganized alfred elements.
    • Ability to remove favorite (btd/btsetfavorite + shift).
    • New blueutil version (v3.9.1).
    • OneUpdater now triggered on every command.
  • 3.0.54 years ago, 4.2 MBDownload

    NEW IN THIS EDITION:

    • Fix disconnect on Monterey.
  • 3.0.44 years ago, 4.2 MBDownload
    • Fix notification not showing up on successful pair.
  • 3.0.34 years ago, 4.2 MBDownload

    NEW IN THIS RELEASE:

    • Corrected suggested commands and keywords in set favorite notification.
  • 3.0.24 years ago, 4.2 MBDownload

    NEW IN THIS EDITION:

    • Updated OneUpdater (automatic updates) script.
  • 3.0.14 years ago, 4.2 MBDownload

    NEW IN THIS EDITION:

    • Updated notificator binary.
    • Added missing workflow icon.
  • 3.0.04 years ago, 4.0 MBDownload

    NEW IN THIS EDITION:

    • Toggle command (bttoggle) is back!
    • New logos for each keyword trigger.
    • Favorite device triggered by btfavorite and cmd-ctrl-alt-f (previously btx'and cmd-ctrl-alt-x).
    • Unpair keyword trigger removed, now accessible thorugh modifier 'cmd' with btd keyword trigger.
    • All scripts now external, making the plugin much less cluttered, as well as easier to mantain and develop.
  • 2.4.24 years ago, 148 KBDownload
    • Pair now works as expected.
  • 2.4.14 years ago, 148 KBDownload
    • Added unpair function (btu)
  • 2.44 years ago, 147 KBDownload
    • Now compatible with macOS 12 onwards. Python included as binary, which ensures compatibility across OS versions.

    Edit: forgot to include alfred binary, now added.

  • 2.3.34 years ago, 152 KBDownload
    • Fixed bug that prohibited successfull pairing.
  • 2.3.25 years ago, 152 KBDownload

    NEW IN THIS EDITION:

    • Fixed bug where unable to disconnect device on MacOS Monterey.
  • 2.3.15 years ago, 152 KBDownload
    • Fixed bug where pair would not work if bluetooth turned off.
    • Externalized connect-script.
  • 2.35 years ago, 149 KBDownload
    • Binary blueutil included, removes need for external installation. (Thanks to @abosnjakovic.)
    • Current favorite now stated in 'btset' list.
    • Re-added 'btx' keyword.
    • Some scripts made alfred-directory external.
    • Improved notification on attempt to trigger non-set favorite device.
    • Fix 'btr' notification to now notify both when turning off and on.
  • 2.25 years ago, 98 KBDownload
    • Removed "btx" and "btt" functions to reduce amount of menu items
    • Dynamic logo color based on device connectivity (idea from @tilmanginzel and @BenjaminVanRyseghem, and the Alfred Bluetooth Workflow)
    • Re-added "btr" (reset) function after accidental removal in v2.0
    • Device search now correctly sorts on customized name
  • 2.1.25 years ago, 88 KBDownload
    • Fixes a bug caused by custom device name set/changed after setting as favorite device. Now finds name dynamically.