我想粘贴我的整个剪贴板历史记录,其中包含在阅读期间复制的单词(Ctrl+C/按选择)。我安装了 Glippy 和 ClipIt 之类的程序,但我不知道如何粘贴所有单词,如果这些程序中存在这样的选项,我会立即复制到一个简单的文本文件中,一次不是一个单词。有人可以帮我吗?
谢谢!
小智 6
您可以使用以下命令在剪辑历史文件中看到一些字符串:
strings ~/.local/share/clipit/history
Run Code Online (Sandbox Code Playgroud)
但这不是最好的方法。输出可能是乱码。
小智 5
ClipIt 有 python 脚本,像这样运行它 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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7947 次 |
| 最近记录: |