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

Feature request(s): unidirectional sync, sync without history #92

Open
foghawk opened this issue Jan 25, 2020 · 4 comments
Open

Feature request(s): unidirectional sync, sync without history #92

foghawk opened this issue Jan 25, 2020 · 4 comments

Comments

@foghawk
Copy link

foghawk commented Jan 25, 2020

I would like to have new selections copied from CLIPBOARD to PRIMARY, but not vice versa. Ideally, I would like to do so without enabling the history feature.

(xcmenu supposedly does this, but it seems to be buggy and its maintenance history isn't promising. I'm not aware of any other no-GUI clipboard manager that can.)

I can put in a PR, if you're willing to offer opinions on:

  • how the configuration should be set up,
  • how unidirectional sync should interact with history, and
  • whether it's really necessary to sync only between "active" selections. (It seems to me that it's not, but perhaps there's a technical reason I haven't spotted just from looking over the code.)

Thanks!

@mrichar1
Copy link
Owner

Hi - I'm just tidying up issues here and spotted that I'd missed this one - many apologies!

Please let me know if you're still using clipster and are still up for making a PR for this feature - otherwise I'll close this one.

@foghawk
Copy link
Author

foghawk commented Sep 6, 2021

No problem; glad to hear from you.

I've never used clipster, but am definitely up for a PR anyway. (xcmenu really is unacceptably buggy. Earlier today I went to paste a link into a chat client and instead sent the text I'd copied from my password manager several selections before. I got mad, changed the password, swore I'd finally do something about this, forgot about it, then checked my email and saw this reply. Serendipitous!)

@mrichar1
Copy link
Owner

mrichar1 commented Sep 9, 2021

That's great to hear! It's been a while since I did any major work on adding features to clipster but I think this one should be relatively easy to implement.

I think the easiest option would be to make sync_selections take options rather than just be a boolean value. Maybe something like:

  • False = don't sync at all
  • True = sync in both directions
  • 'to_primary' = sync from clipboard to primary
  • 'to_clipboard' = sync from primary to clipboard

The 2 places that would need updated are in update_history (around line 455) and delete_handler (around line 252).

test_sync_selections in the test suite could then be duplicated and tweaked for the 2 new 'direcitonal' syncs.

Let me know if this sounds like something you'd be up for making a PR for - happy to review and comment on one, but not got the time just now to implement it myself!

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 16, 2022
@stale stale bot closed this as completed Apr 28, 2022
@mrichar1 mrichar1 reopened this Apr 28, 2022
@stale stale bot removed the stale label Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants