vldmrkl / airdrop-cli

A macOS CLI for AirDrop written in Swift
MIT License
200 stars 18 forks source link

Support for sending stdin/arbitrary strings? #12

Open woodruffw opened 1 year ago

woodruffw commented 1 year ago

First of all, thanks for this tool! It looks very useful, and I'd love to integrate it into some of my projects.

I see that support for files and URLs are currently supported, but the underlying NSSharingService API should work with anything that implements NSPasteboardWriting, which includes things things like NSStrings.

Give that: would you be interested in support for sending arbitrary strings and/or treating - as stdin so that it could be streamed in? If so, I'm happy to try and add support for that.

vldmrkl commented 1 year ago

@woodruffw sure, that'd be great to have. Please feel free to add support for it! Just out of curiosity, what use cases do you have in mind?

woodruffw commented 1 year ago

Glad to hear it! I'll poke around and try to add support tonight or tomorrow night.

Just out of curiosity, what use cases do you have in mind?

I have my own little password manager, and I'd like to be able to AirDrop passwords from my desktop to my phone and other devices: https://github.com/woodruffw/kbs2/issues/234

I'm still not 100% sure if this is the best way to accomplish that, but I'm happy to add the feature regardless :slightly_smiling_face:

echkourine25 commented 3 months ago

Hi i want to use this in zsh : find . -name ".flac" | airdrop - but I have a usage error and with airdrop - < find . -name ".flac" I have zsh: no such file or directory: find