Bug 510961

Summary: RFE: infinite clipboard history in Klipper
Product: [Plasma] plasmashell Reporter: Paul Wise <pabs3>
Component: Clipboard widget & pop-upAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: wishlist CC: nate, qydwhotmail
Priority: NOR    
Version First Reported In: 6.5.0   
Target Milestone: 1.0   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Python script to sync the Klipper database to filesystem xattrs

Description Paul Wise 2025-10-23 13:51:00 UTC
I've switched from GNOME with GPaste to KDE Plasma Workspace and Klipper. One advantage of GPaste over Klipper is that GPaste has a much maximum larger history size of 65535 vs Klipper's 2048, so I still have GPaste running and have had to resort to it occasionally for finding old clipboard entries that I missed from the Klipper history. I found the Klipper clipboard actions menu feature really useful, so I love Klipper despite the low limit. I also heard about CopyQ, which has a clipboard history limit of 100000. So now I have three clipboard managers installed and running. GPaste for accessing old data from GNOME, Klipper for the actions and CopyQ for keeping more future clipboard data. OTOH I would prefer to have infinite history, if Klipper were to add infinite history (or even just a much larger limit) then I could figure out how to do a one-time conversion of old data from GPaste/CopyQ to Klipper and then remove GPaste/CopyQ.

https://github.com/Keruspe/GPaste
https://hluk.github.io/CopyQ/
Comment 1 Nate Graham 2025-10-23 15:50:57 UTC
We've intentionally decided against infinite (well, nearly infinite) clipboard size, sorry. It would expose too many weird edge case bugs.
Comment 2 Paul Wise 2025-10-24 01:31:33 UTC
OK, thanks for the reply. I guess I'll look at making a local fork then.
Comment 3 Paul Wise 2025-11-01 04:37:07 UTC
Created attachment 186377 [details]
Python script to sync the Klipper database to filesystem xattrs

Recompiling plasma-workspace takes too long on my old machine, so it is hard to work on this.

So I came up with a workaround, I'm mentioning it here in case anyone else wants a workaround for this too.

First sync the database to xattrs using the attached script (so that all the metadata is retained outside the database, which is maintained by Klipper), then use rsync without any delete option to keep a copy of the files, then automatically run those steps hourly using cron or systemd timers:

  rsync -aSHAX ~/.local/share/klipper/ ~/backup/klipper/

In the process of writing the script I came across a few entries that didn't have corresponding files, but couldn't find anywhere in the plasma-workspace klipper code that would have excluded them. The script handles that case by creating new dirs, and creating new files copying the text column from the main table of the database.

I don't have anything to search the old data yet, I expect I will just use grep for now.