Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy 2FA codes to system clipboard #12

Open
pzmarzly opened this issue May 15, 2022 · 2 comments
Open

Copy 2FA codes to system clipboard #12

pzmarzly opened this issue May 15, 2022 · 2 comments

Comments

@pzmarzly
Copy link
Owner

When an user receives an SMS message, we get a notification over ANCS (as long as user doesn't have Messages silenced).

It would be amazing if ancs4linux-desktop-integration could parse text messages, and if a string of 4-8 digits is found, add a Copy button to its desktop notification, that would trigger xclip/wl-clipboard.

@gfarrell
Copy link

This is exactly what I was looking at this for, but was assuming that I could script ANCS somehow.

@pzmarzly
Copy link
Owner Author

Well, an external script would also work. Just listen to ShowNotification signal in anccs4linux.observer API.

When making ancs4linux I chose D-Bus as I wanted a good interop with other languages, so you can even use bash for everything. However, it's a bit easier to just use Python and have a strongly-typed API with from ancs4linux.common.apis import ObserverAPI, ShowNotificationData. I think you can easily develop both in-tree and outside of the project (as ancs4linux gets globally installed). In the future I may want to make some plugin system to make distributing community-made components easier.

I suspect most complexity in this feature comes from:

  • how to recognize 2FA code?
  • how to put it in user's clipboard?

Do you want to try working on it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants