Jump to content
Acidham

AirPod Connector

Recommended Posts

Posted (edited)

I know, it is an another AirPod Connector but I am an owner of 3 pairs of them, and I was not able to find an AirPod Connector which supports more than one pair. In addition, the WF runs out of the box without any configuration. 

 

Download on Git

airpd_screen.png

Edited by Acidham

Share this post


Link to post
1 hour ago, Acidham said:

The Workflow requires blueutil


brew install blueutil

 

Would you like it not to require users to have to manually install the dependency? I can help you set up _sharedresources, if you’d like. blueutil is supported, as I use it in one of my Workflows.

Share this post


Link to post

@vitor sure would be wonderful. What is preferred way to start integrating it? Should I read manual first or is it meant to get premium support from you ? 🤗

Share this post


Link to post

@Acidham Just like OpenUpdater, it’s meant to be as simple as possible.

  1. Add the script to your Workflow. Doesn’t matter where you put it; it’s wherever is convenient to you.
  2. Inside any script that requires blueutil, run /path/to/_sharedresources blueutil.
  3. Set the result of the previous command to the PATH environment variable.
  4. Call blueutil as usual.

In Bash you’d so something like (assuming _sharedresources and the script are in the same directory):

PATH="$(./_sharedresources 'blueutil')"
blueutil WHATEVER

In Ruby:

require 'open3'
ENV['PATH'] = Open3.capture2('./_sharedresources', 'blueutil').first
Open3.capture2('blueutil', WHATEVER)

Share this post


Link to post
Posted (edited)

what about Python?

import os

os.environ['PATH'] = os.popen('./_sharedresources "blueutil"').readline()
os.popen('blueutil WHATEVER')

 

Edited by Acidham

Share this post


Link to post
37 minutes ago, Acidham said:

what about Python?

 

I assumed it would be just as simple, but since you are a Pythonista and I’m not, I was confident you’d reach the best solution from my examples.

Share this post


Link to post
14 minutes ago, vitor said:

Don’t forget you can edit the top post to remove the blueutil requirement.


not sure I understand. Which top post ?

Share this post


Link to post
Just now, Acidham said:

not sure I understand. Which top post ?

 

The first one on this thread.

 

Share this post


Link to post

This does not seem to work on Catalina - I activate the script but nothing happens. However the script correctly reads if the AirPods are connected or not. I installed the developer tool that was required

Share this post


Link to post

I am on Catalina and no issues....

 

1. what is the output when you enter ...

blueutil -v

....in terminal?

2. What is log output of Alfred...open workflow and click on the bug on top right corner

Edited by Acidham

Share this post


Link to post

Same thing for me; nothing happens when I input the keyword. I downloaded the workflow and let the program download something. 

 

Here's my results:

1.

-----------------------------------------------------------------------

Last login: Mon Jul  6 15:12:53 on ttys000

user@MacBook-Pro ~ % blueutil -v

zsh: command not found: blueutil

user@MacBook-Pro ~ %

-----------------------------------------------------------------------

 

2.

-----------------------------------------------------------------------

[15:16:20.645] ERROR: AirPods Connector[Run Script] /Users/user/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/D0C9763C-E272-427B-8A49-1EAA4862E448:1: no such file or directory: /usr/local/bin/blueutil

Untitled_Artwork 2.jpg

 

 

 

Update: After installing blueutil on terminal, it's working as intended now.

 

P.S.: Thanks! 👍

Edited by epistaxis
Update

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...