p0deje / Maccy

Lightweight clipboard manager for macOS
https://maccy.app
MIT License
11.84k stars 510 forks source link

Option for "Clear history on quit" to not store history on disk #733

Open AviKav opened 6 months ago

AviKav commented 6 months ago

Before Submitting Your Feature Request

Problem

Currently Maccy writes history to ~/Library/Containers/org.p0deje.Maccy/Data/Library/Application Support/Maccy/Storage.sqlite stores history when "Clear history on quit" is checkmarked.

Coming from KDE's Klipper, I assumed Maccy would only store history in memory with this option. I didn't really think twice about it until I noticed the wording and decided to double check

Solution

A sub-option for "Clear history on quit" that doesn't write history to disk

p0deje commented 6 months ago

Thank you for the feedback! This is not something I had on my mind, can you please provide more details about why you'd want this added?

Even though it might be possible to implement this via Core Data, I'm not sure how practical this would be. There are already multiple issues related to memory bloat (#384, #726) and the desire to keep unlimited history (#310) so I wonder how this would complicate the implementation, supporting simultaneously both disk/memory storage backends.

AviKav commented 6 months ago

can you please provide more details about why you'd want this added?

Short answer, because when I copy something sensitive into my clipboard I don't want to rely on checking if Maccy has been temporarily disabled

unlimited history

I'd think enabling it would be mutually exclusive with in-memory-only, but maybe not?

so I wonder how this would complicate the implementation, supporting simultaneously both disk/memory storage backends.

I think the most complicated thing would be migrating items between stores and exposing the "when" to users.

There's also the question of what to do about pinned items as there's merits to both persisting and not persisting them

p0deje commented 6 months ago

I generally wouldn't mind supporting that so PRs are welcome, but I won't be able to implement this myself.