版权 © 2009 Mike Massonnet
版权 © 2009. Hunt Xu (huntxu@live.cn)
在自由软件基金会发布的 GNU 自由文档许可协议版本 1.3 或以后版本的条款约束下允许复制,分发和/或修改本文档,不要求保留特定内容、封面文本或者封底文本。许可协议全文可以通过以下链接找到: Free Software Foundation。
April, July 2009
Clipman is a clipboard manager for Xfce. It keeps the clipboard contents around while it is usually lost when you close an application. It is able to handle text and images, and has a feature to execute actions on specific text by matching them against regular expressions.
在 X11 (所有的 Unix 平台) 中,默认有两个剪贴板用以交换各窗口间的数据。其中的一个剪贴板(我们称之为预设剪贴板)用以手动复制(例如您选择一个文件之后点击复制按钮),而另一个(我们称之为主剪贴板)用以选中复制(例如您选中在文本框中的文本)。
Clipman handles only the default clipboard, but optionnaly it can also notice the selections. When it is handling the selections, the default clipboard will always be synced with it and contain the same data. By this meaning you can paste with the keyboard what you select on screen.
Clipman is used to keep in history a list of clipboard contents and to restore them. The history is displayed in a menu by clicking on the main icon. Within the menu it is possible to restore a text and to clear the history.
There are two ways to run Clipman. You can select Clipman in the applications menu under the category
Utility or type xfce4-clipman
on the command-line, or you can add it into your panel.
To add a new item in the panel right click the panel and select “Add new item…”.
通过右键点击主图标,并选择菜单中的“属性”项可以打开设置对话框。它允许您调节剪贴板历史的相关属性或者编辑动作。
以下是可用选项的列表:
表 1. 设置对话框中的常规选项
选项 | 描述 |
---|---|
Sync selections | 同步主剪贴板的内容到预设剪贴板中以粘贴选中的内容 |
从历史中排除 | 不将主剪贴板中的内容加入到历史中 |
保存并退出 | 在每次新会话中恢复历史 |
保存一幅图像 | 允许在历史中保存一幅图像 |
历史大小 | 设置保留在历史中的条目数量 |
一个动作由一个“动作名称 - 正则表达式”对构成。每一个动作可以执行一个或一个以上的命令。对动作的支持是程序的可选项,您能够通过“允许动作”选项启用或禁用该支持。
要添加一个动作,请点击添加图标;要编辑一个动作,请选择该动作并点击编辑图标或者直接双击该动作;要删除一个动作,请选择该动作并点击删除图标。选择添加或者编译一个动作,一个新对话框将会被打开。
To learn more about actions go to “动作对话框”一节.
An action has a human readable name that describes the pattern it is going to match. An action must have at least one command which also has a human readable name. The matched text can be reused in the command.
The actions are always matched against text selections unless specified otherwise. When the box “Activate only on manual copy” is checked, the action will be matched from the default clipboard (e.g. with Ctrl+C).
基本特殊字符: ".?+*(|)[]\
"。
.
”: 代表任意单个字符。?+*
”: 分别代表零或一个字符,一个或一个以上字符,以及任意多个(包括0个)字符。(|)
”: 在分组和替换中,竖线(|)用以表示 “或” 。[^]
”: 在一系列字符或特殊字符中匹配一个字符时,“^” 符号在开头使用表示否定。\
”: 将特殊字符作为普通字符进行匹配。基本的字母和数字字符类: "A-Za-z0-9
"。 字符类用于方括号中表示一系列的字符。
bug ?#?[0-9]+
": 文本 "bug",零或一个空格,零或一个 “#” 字符,后面是一个或多个数字。(http|ftp).+\.(jpg|png|gif)
": 文本 "http" 或 "ftp",一或多个字符,一个点,后面是文本 "jpg","png" 或 "gif"。http://.{120}[^ ]+
”: 文本“http://”,120 个字符,后面加一个或一个以上非空格的字符。
Clipman uses Xfconf to store its settings. That allows you to change the settings with the tool
xfconf-query
or xfce4-settings-editor
. The channel is
xfce4-panel
and the base property is /plugins/clipman
. The following
table lists all the properties with their possible values:
表 2. Xfconf 属性
属性 | 类型 | 默认 | 值 |
---|---|---|---|
/settings/add-primary-clipboard | 布尔值 | 假 | 设置为真将同步主剪贴板中的内容到预设剪贴板中 |
/settings/enable-actions | 布尔值 | 假 | 设置为真将允许动作 |
/settings/history-ignore-primary-clipboard | 布尔值 | 假 | 设置为真将从历史中排除主剪贴板的内容 |
/settings/max-images-in-history | uint | 0 | 0-5 个图像内容在历史中 |
/settings/max-texts-in-history | uint | 10 | 5-100 个文本内容在历史中 |
/settings/save-on-quit | 布尔值 | 真 | 设置为真将在每次新会话中恢复历史 |
To change a setting from a terminal type the command-line:
xfconf-query -c xfce4-panel -p /plugins/clipman/<property> -s <value>
报告错误或者希望添加新的功能,请使用在 http://bugzilla.xfce.org/ 上的 bug 追踪系统。如果您在此软件的使用上有任何疑问,请在邮件列表 Xfce mailing list 上发问,或者使用 IRC 客户端连接至 irc.freenode.net,加入频道 #xfce 寻求帮助。
Clipman 最初由 Eduard Roccatello 所编写,而后由 Nick Schermer 维护。现在的编写者是 Mike Massonnet (<mmassonnet@xfce.org>
)。更多信息,请查看 Clipman 网站。
这份文档由 Mike Massonnet (<mmassonnet@xfce.org>
) 撰写。请将您对这份文档的意见或建议发送到 <mmassonnet@xfce.org>
。
此软件在自由软件基金会发布的 GNU 通用公共许可协议 条款约束下发布;协议的第二版或者(您可以选择)更新的版本。
您应该能够随此软件获得一份 GNU 通用公共许可协议的副本;如果没有,请致信自由软件基金会: Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA.