extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Update 'Toothpick' Extension

Open VladCuciureanu opened this issue 2 years ago • 17 comments

Description

Observe and manage your bluetooth devices with a few keystrokes. This extension provides a quick and easy way to connect/disconnect bluetooth devices, right from Raycast. This is possible by making use of Apple's bluetooth frameworks via AppleScript.

Screencast

Screenshot of the extension

Checklist

VladCuciureanu avatar Aug 21 '22 16:08 VladCuciureanu

Thank you for your first contribution! :tada:

🔔 @briankosw you might want to have a look.

raycastbot avatar Aug 21 '22 16:08 raycastbot

Hi @VladCuciureanu. Did you notice this extension Toothpick in the store?

koinzhang avatar Aug 22 '22 02:08 koinzhang

Well that is awkward... No, I didn't notice it. It actually shows up when searching for 'Bluetooth' too, but I missed it somehow.

To be fair though, my extension has battery level meters for wireless earbuds (case, left earbud, right earbud): bluetooth-2

As well (e.g. AirPods) and also icons for specific devices: Screenshot 2022-08-22 at 09 19 50 I was actually working on icons for Sony, Samsung and Bose devices too...

Would be a shame to waste all the work I put into this but I don't wish @briankosw ill either. Is there a way to still make use of my extension without sidetracking Toothpick?

VladCuciureanu avatar Aug 22 '22 06:08 VladCuciureanu

Hi 👋

Thanks for your contribution and your time spent creating this extension. As you already know, we have a similar extension, and it doesn't make much sense to have almost identical extensions in the store.

What about contributing your enhancements to the other extension? I'm sure that @briankosw and the users would enjoy the extension enhanced 🙂

pernielsentikaer avatar Aug 23 '22 08:08 pernielsentikaer

@pernielsentikaer Please tell me if any further modifications are needed. Otherwise, should be good to go.

VladCuciureanu avatar Aug 23 '22 11:08 VladCuciureanu

Can you check this out @briankosw

pernielsentikaer avatar Aug 26 '22 19:08 pernielsentikaer

@pernielsentikaer What is your policy on the owner of an extension not being contactable?

VladCuciureanu avatar Sep 08 '22 10:09 VladCuciureanu

Hi @VladCuciureanu 👋

I just gave it a quick spin and it seems like I lost battery status. Do you have a clue what might cause that?

CleanShot 2022-09-20 at 13 09 51@2x

In certain circumstances the magic devices stop sending their battery data. Do you happen to have them plugged in by cable? That does it for me sometimes.

Edit: found a way to get battery level in all statuses and I will return with a commit later.

VladCuciureanu avatar Sep 20 '22 11:09 VladCuciureanu

No wired at the moment and the image is taken in the same second so both should be able to use the same data 🙂

pernielsentikaer avatar Sep 20 '22 11:09 pernielsentikaer

I have kind of a reverse situation going on here on my travel macbook.

Old Screenshot 2022-09-20 at 21 27 48 New Screenshot 2022-09-20 at 21 31 05

Sadly I'm not sure we can coax the APIs (that Apple gives us access to, at least) into giving us battery info in certain situations. For example, the old implementation that uses 'ioreg' doesn't seem to want to return AppleDeviceManagementHIDEventService class devices on my travel laptop (runs Monterey).

I suggest moving forward with my implementation though. The reasoning being that it doesn't depend on the device being an AppleDeviceManagementHIDEventService class device, which means that my implementation has potential support for non-apple devices, whereas the older implementation does not.

I know this does not fix the missing battery problem on your devices but this seems like a good compromise for now. I'll look some more into the missing battery problem next week, when I'm back from my vacation.

VladCuciureanu avatar Sep 20 '22 19:09 VladCuciureanu

Added a few more requested features in the meanwhile:

  • Added 'Connect to' and 'Disconnect from' commands
  • Added favorite devices functionality for quick connecting to specific devices
  • Added option to close the window when successfully connecting to a device.

VladCuciureanu avatar Sep 25 '22 15:09 VladCuciureanu

Still no percentage for me, it feels a bit like a tradeoff even though the rest of the commands is improved. Can I help debug this somehow? Seems to always work in the current version.

CleanShot 2022-10-06 at 13 57 33@2x

pernielsentikaer avatar Oct 06 '22 11:10 pernielsentikaer

Still no percentage for me, it feels a bit like a tradeoff even though the rest of the commands is improved. Can I help debug this somehow? Seems to always work in the current version.

CleanShot 2022-10-06 at 13 57 33@2x

Could you check if it works now? Reimplemented previous method as a backup method for fetching device battery levels.

VladCuciureanu avatar Oct 07 '22 13:10 VladCuciureanu

Sorry but... Bump @pernielsentikaer

VladCuciureanu avatar Oct 26 '22 14:10 VladCuciureanu

Sorry for letting you wait @VladCuciureanu; I gave it another spin and now it at least shows on of the two percentages; however it's the wrong one it shows 🫣

CleanShot 2022-10-27 at 08 52 06@2x

pernielsentikaer avatar Oct 27 '22 06:10 pernielsentikaer

No worries about the delay. I'll see what I can do ⚰️😵

EDIT: @pernielsentikaer could you provide me with the output of the following command? Only if it is ok with you. ioreg -a -c AppleDeviceManagementHIDEventService

VladCuciureanu avatar Oct 27 '22 07:10 VladCuciureanu

You got e-mail 😊

pernielsentikaer avatar Oct 27 '22 11:10 pernielsentikaer

Published to the Raycast Store: https://raycast.com/briankosw/toothpick

raycastbot avatar Nov 01 '22 14:11 raycastbot