Clipman Manual

Mike Massonnet

This manual describes version 1.0.2 of Clipman.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. The complete license text is available from the Free Software Foundation.

April 2009


Table of Contents

Introduction
Anatomy of a Clipboard
Getting Started
Popup Command
Settings
General
Actions
Xfconf
Action
Regular Expression
Command
Support
About Clipman

Introduction

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 selections by matching them against regular expressions.

Anatomy of a Clipboard

In X11 (all Unix platforms) there are by default two clipboards to exchange any data between the windows. A default clipboard which is modified by manual copies (for instance when you select a file and press the copy button), and there is a primary clipboard which is modified by selections (for instance when you select text in a field).

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.

Getting Started

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 select an item to restore it, to clear the history and to activate or deactivate the clipboard manager.

Figure 1. Clipman Menu

Menu displaying 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-plugin 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…”.

Popup Command

Clipman provides the command-line tool xfce4-popup-clipman. When called it popups the main menu. The command is practical for the Application Shortcuts available at Xfce Menu+Settings+Keyboard.

Settings

The settings dialog is available under the “Properties” item in the right click context menu on the main icon. It allows to tweak the history and to edit actions.

General

The following table describes the available options:

Table 1. General options in the Settings dialog

OptionsDescription
Add selectionsSync the primary clipboard with the default clipboard in a way that it is possible to paste what gets selected
Exclude from historyPrevents the primary clipboard from being inserted in the history
Save on quitKeeps the history at every new session
Store an imageAllows to store one image in the history
Size of the historySets the number of items to keep in history

Figure 2. Clipman Settings

Settings dialog with the General tab

Actions

An action is a pair of an action name and a regular expression. Each action can have one or more commands. The support of actions is optional and can be enabled or disabled through the “Enable actions” option.

To add an action click the Add icon, to edit an action select the action and click the Edit icon or double click the action, and to remove an action select an action and click the Delete icon. By adding or editing an action a new dialog is opened.

To learn more about actions go to the section called “Action”.

Figure 3. Clipman Settings

Settings dialog with the Actions tab

Xfconf

Clipman uses Xfconf to store its settings in the xfce4-panel channel. That allows you to change the settings with the tool xfconf-query. The following table lists all the properties with their possible values:

Table 2. Xfconf Properties

PropertyTypeDefaultValues
/plugins/clipman/settings/add-primary-clipboardboolfalsetrue to sync the primary clipboard with the default clipboard
/plugins/clipman/settings/enable-actionsboolfalsetrue to enable actions
/plugins/clipman/settings/history-ignore-primary-clipboardboolfalsetrue to exclude the primary clipboard from the history
/plugins/clipman/settings/max-images-in-historyuint00-5 number of images in history
/plugins/clipman/settings/max-texts-in-historyuint105-100 number of texts in history
/plugins/clipman/settings/save-on-quitbooltruetrue to restore the history at every new session

To change a setting type the command-line:

xfconf-query -c xfce4-panel -p <property> -s <value>

Action

An action has a human readable name that describes the pattern it is going to match. The matches are made against text from the selections and the pattern is a regular expression. An action must have at least one command which also has a human readable name. The matched text can be reused in the command.

Figure 4. Action Dialog

Action edit dialog

Regular Expression

Basic special characters: ".?+*(|)[]\".

  • .”: represents a single character.
  • ?+*”: respectively means zero or one character, one or more characters, and zero or more characters.
  • (|)”: used for grouping and substitution, the vertical bar is used as an OR operation.
  • [^]”: used to match a character from a set of characters and special characters, the circumflex is used at the start as a negation.
  • \”: escapes a special character.

Basic alphanumeric character class: "A-Za-z0-9". Character classes are used within square brackets to represent a set of characters.

Examples

  • "bug ?#?[0-9]+": text "bug ", zero or one space, zero or one sharp character, and one or more numbers.
  • "(http|ftp).+\.(jpg|png|gif)": text "http" or "ftp", one or more character, a point, and the text "jpg", "png" or "gif".
  • "http://.{120}[^ ]+": text "http://", 120 characters, and one or more characters except a space.

External Ressource

Have a look at the Wikipedia article about regular expressions.

Command

A command can reuse one or more substitutions from the regular expression. The substitutions are represented by ”\<number>” where <number> corresponds to the sub-pattern within parentheses or 0 for the complete text.

For example, from the simple pattern ”bug #(123)” it is possible to use ”\0” for the text “bug #123” and ”\1” for the text “123”. For the command ”exo-open http://host/\1”, the real executed command would be ”exo-open http://host/123”.

Support

To report a bug or a feature request use the bug tracking system at http://bugzilla.xfce.org/. If you have questions about the use of this software, please ask on the Xfce mailing list or point your IRC client to irc.freenode.net, join the channel #xfce and ask for help.

About Clipman

Clipman was written by Eduard Roccatello and then maintained by Nick Schermer. Nowadays it is written by Mike Massonnet (). Visit the Clipman Web site.

This documentation was written by Mike Massonnet (). Please send all your comments and suggestions regarding this manual to .

This software is distributed under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA.