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

Don't lose clipboard history on Gnome lock/unlock (with entries not saved to disk) #196

Open
szpak opened this issue Feb 14, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@szpak
Copy link

szpak commented Feb 14, 2025

Problem description

I have "Only save favorites to disk" enabled. When I lock/unlock computer, all history entries are removed which is problematic when you often lock the computer (e.g. working in the office). I would like to keep it until computer restart.

Potential solutions/workarounds

I originally discussed this issue in Tudmotu/gnome-shell-extension-clipboard-indicator#91 (comment), proposing keeping the entries in global map, which survives the lock/unlock cycle. As it was mentioned in Tudmotu/gnome-shell-extension-clipboard-indicator#338, I thought it was "enhanced" in gnome-clipboard-history, but it doesn't work for me in the extension version 45 (in the meantime, I have been using some not Gnome related tool for that).

I wonder, if it worked originally, but regresses in the meantime (and maybe could be "restored")?

Additional context

I saw #194 , so the second question is whether it is possible with Ringboard to keep clipboard history only in the process memory, not persisting it on disk?

@szpak szpak added the enhancement New feature or request label Feb 14, 2025
@SUPERCILEX
Copy link
Owner

Regarding Ringboard, I've been told that it doesn't work perfectly on Gnome with Wayland because they don't implement the right protocols. I'd love it if more people tried it and confirmed, but anyway my point is that I'm actually not sure if Ringboard is a great replacement yet on Gnome.

Do you have favorites you want to keep across reboots? If no, then the solution is somewhat straightforward for either the extension or Ringboard: mount the data directory as a tmpfs and let the os wipe the data on reboot. If you do use favorites, then Ringboard is a bit better in the sense that you can manually make API calls to repopulate favorites on startup, but that sounds like a pain. Another option is to use the API to target non-favorites entries for deletion, but this requires running a script before shutdown and the data will still be on disk if your computer crashes fore example.

In general I don't agree with not saving data to disk because it means you're stuck with an effective memory leak. In the extension it's not bad since we only store text, but Ringboard stores images among other things which you don't want to have sitting in memory forever.

@szpak
Copy link
Author

szpak commented Feb 15, 2025

but anyway my point is that I'm actually not sure if Ringboard is a great replacement yet on Gnome.

Thanks for clarification.

In general I don't agree with not saving data to disk because it means you're stuck with an effective memory leak

As I occasionally copy-paste also secrets, I don't feel comfortable with persisting it on disk (even with Luks) . tmpfs is some idea - to do not forget of plain text passwords on disk stuck forever - but gathering saved passwords from the process memory it somehow harder/less popular for "password finders". Of course, I agree, I might be bias about that aspects of security :).

You are completely right about the memory leaks. That's why I like your extension for keeping only text values. With the limited number (ring) of entries (and sanity with not copying whole books), it should not be a real problem.

@SUPERCILEX
Copy link
Owner

Fair enough. The folder you'll want to mount is ~/.cache/clipboard-history@alexsaveau.dev.

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

No branches or pull requests

2 participants