How do I copy the whole history of the clipboard to a text file?

You can see some strings in clipit history file with this command:

strings ~/.local/share/clipit/history

But it's not the best way. The output may be garbled.


there is python script for ClipIt run it like this python cliphist.py > clipit.history.txt

#!/usr/bin/env python
"""cliphist.py: utility to print clipit history file.
If an argument is passed on the command line, it will
be used as a separator, otherwise history items are
separated by a blank line. """

import struct, os, sys

homedir  = os.environ['HOME']
histfile = homedir + '/.local/share/clipit/history'
if len(sys.argv) > 1:
    sep = sys.argv[1]
else:
    sep = '---------------------------------------------------------------------'


with open(histfile,'rb') as f:
    f.read(68)
    size,_ = struct.unpack('2i',f.read(8))
    while (size > 0):
        item = f.read(size)
        print item
        _,_,_,size,_ = struct.unpack('5i',f.read(20))
        if size > 0: 
            print sep

The latest version of Parcellite has a Save As menu item when clicking the icon. This will save all the history entries to a file. There is also a paste all when right-clicking the history list, which will place the entire history list on the clipboard. The preferences have a Paste All delimiter that it will put at the end of each entry.

https://sourceforge.net/projects/parcellite/files/parcellite/parcellite-1.1.1/ ppa here: https://launchpad.net/~rickyrockrat/+archive/ppa