📦 Windows剪贴板管理器 — Windows 剪贴板管理器
v1.0.0Windows剪贴板管理器 - 原创技能。管理Windows剪贴板,支持复制、粘贴、历史记录、多条目管理、格式化转换等功能。适用于数据处理、批量操作、跨应用数据交换等场景。
详细分析 ▾
运行时依赖
安装命令
点击复制技能文档
⚠️ 发布规则 所有发布到 ClawHub 的技能必须严格测试,确定没有问题再发布。
技能测试验证清单
- frontmatter 格式正确
- 功能完整
- 命令清晰
- 历史管理实用
- 无语法错误
Clipboard Manager - 剪贴板管理器 原创技能 | 激活词:剪贴板 / 复制粘贴 / 剪贴板历史
功能概述 功能 | 说明 读写剪贴板 | 读取/写入文本、图像、文件 历史记录 | 保存最近 N 条剪贴板内容 多条目管理 | 快速切换不同内容 格式转换 | 文本↔图片、JSON 格式化 搜索过滤 | 在历史中搜索内容
安装依赖 pip install pyperclip Pillow
核心命令
- 基本读写
- 图像操作
- 剪贴板历史
- 格式化转换
- 多剪贴板管理
使用场景 场景 1: 代码片段收集 clipboard_manager.save("snippet1") clipboard_manager.save("snippet2") clipboard_manager.load("snippet1")
场景 2: 批量数据处理 add_quotes()
场景 3: JSON 格式化 format_json()
场景 4: 文本整理 text_to_lines()
实用命令集 # 复制文件路径到剪贴板 def copy_file_path(file_path): pyperclip.copy(file_path) # 复制当前时间 def copy_current_time(): pyperclip.copy(datetime.now().strftime("%Y-%m-%d %H:%M:%S")) # 复制当前日期 def copy_current_date(): pyperclip.copy(datetime.now().strftime("%Y-%m-%d")) # 全转大写 def to_uppercase(): text = pyperclip.paste() pyperclip.copy(text.upper()) # 全转小写 def to_lowercase(): text = pyperclip.paste() pyperclip.copy(text.lower()) # 首字母大写 def capitalize(): text = pyperclip.paste() pyperclip.copy(text.title()) # 去重换行 def deduplicate_lines(): text = pyperclip.paste() lines = text.split('\n') unique = list(dict.fromkeys(lines)) pyperclip.copy('\n'.join(unique)) # 反转顺序 def reverse_lines(): text = pyperclip.paste() lines = text.split('\n') reversed_lines = lines[::-1] pyperclip.copy('\n'.join(reversed_lines)) # 去除空白行 def remove_blank_lines(): text = pyperclip.paste() lines = [line for line in text.split('\n') if line.strip()] pyperclip.copy('\n'.join(lines))
剪贴板监控 import time import threading class ClipboardMonitor: def __init__(self, callback): self.callback = callback self.running = False self.last_content = "" def start(self): self.running = True thread = threading.Thread(target=self._monitor) thread.daemon = True thread.start() def stop(self): self.running = False def _monitor