Difference between revisions of "Clipboard"

From ArchWiki
Jump to: navigation, search
(replace gvim section with link to gvim page; rename section to "Disable paste on middle mouse click" which is more precise; put application specific stuff under new headline)
 
(66 intermediate revisions by 30 users not shown)
Line 1: Line 1:
[[Category:X Server]]
+
[[Category:X server]]
 
[[fr:Copier coller]]
 
[[fr:Copier coller]]
{{expansion}}
+
[[ja:クリップボード]]
==History==
+
From [[Wikipedia:Clipboard (computing)]]:
 +
:The clipboard is a facility used for short-term data storage and/or data transfer between documents or applications, via [[Wikipedia:copy and paste|copy and paste]] operations.
 +
 
 +
== History ==
 +
 
 
In X10, "cut buffers" were introduced. These were limited buffers that stored arbitrary text and were used by most applications. However, they were inefficient and implementation of them varied, so selections were introduced. Cut buffers are long deprecated, and although some applications (such as xterm) may have legacy support for them, it is both not likely and not recommended that they be used.
 
In X10, "cut buffers" were introduced. These were limited buffers that stored arbitrary text and were used by most applications. However, they were inefficient and implementation of them varied, so selections were introduced. Cut buffers are long deprecated, and although some applications (such as xterm) may have legacy support for them, it is both not likely and not recommended that they be used.
  
==Background==
+
== Background ==
The ICCCM (Inter-Client Communication Conventions Manual) standard defines three "selections": PRIMARY, SECONDARY, and CLIPBOARD. Despite the naming, all three are basically "clipboards". Rather than the old "cut buffers" system where arbitrary applications could modify data stored in the cut buffers, only one application may control or "own" a selection at one time. This prevents inconsistencies in the operation of the selections. However, in some cases, this can produce strange outcomes, such as a bidirectional shared clipboard with Windows (which uses a single-clipboard system) in a virtual machine.
+
 
 +
The [http://tronche.com/gui/x/icccm/ ICCCM] (Inter-Client Communication Conventions Manual) standard defines three "selections": PRIMARY, SECONDARY, and CLIPBOARD. Despite the naming, all three are basically "clipboards". Rather than the old "cut buffers" system where arbitrary applications could modify data stored in the cut buffers, only one application may control or "own" a selection at one time. This prevents inconsistencies in the operation of the selections. However, in some cases, this can produce strange outcomes, such as a bidirectional shared clipboard with Windows (which uses a single-clipboard system) in a virtual machine.
 +
 
 +
Of the three selections, users should only be concerned with PRIMARY and CLIPBOARD. SECONDARY is only used inconsistently and was intended as an alternate to PRIMARY. When some applications treat PRIMARY and CLIPBOARD differently, this can cause confusion and, in some cases, inconsistent or undesirable results, but the majority of applications shows the behaviour detailed in the next section.
 +
 
 +
== How to use the selections (clipboards) ==
 +
 
 +
{{Accuracy|Shortcuts and usage are application-specific (even synchronization is possible with a clipboard manager), nothing is copied anywhere [http://unix.stackexchange.com/questions/213840/how-to-toggle-or-turn-off-text-selection-being-sent-to-the-clipboard/213843#213843 until it is pasted] (unless clipboard manager is used).}}
 +
 
 +
There are two common selections (clipboards), which can have different values stored in them. Synchronization of both is possible with [[#List of clipboard managers|clipboard managers]].
 +
 
 +
The CLIPBOARD selection is accessed using keyboard shortcuts, while application specific, these are most commonly {{ic|ctrl+c}} for copying, {{ic|ctrl+v}} for pasting and {{ic|ctlr+x}} for cutting.
 +
 
 +
The PRIMARY selection speeds up the copying task by copying the text to the clipboard as soon as it was selected with the mouse, without the need for entering a keyboard shortcut. Pasting is triggered by pressing the middle mouse button (or some emulation of it).
 +
 
 +
{{Note|The clipboard may also contain other items than text, such as images or folders.}}
 +
 
 +
== Application specific notes ==
 +
 
 +
=== Konsole terminal ===
 +
The {{Pkg|konsole}} terminal allows to use the shortcut {{ic|ctl+c}} both for copying text and for stopping commands. The behaviour depends on whether there is something selected or not.
 +
 
 +
=== CLIPBOARD in Gvim ===
 +
See [[Vim#Clipboard_.28gvim.29]].
 +
 
 +
== Disable paste on middle mouse click ==
 +
 
 +
Currently the only simple way to completely disable pasting with the middle mouse button across all applications is to disable the middle mouse button, which then also loses its other functions such as closing tabs. The applications listed below have specific settings to disable it.
 +
 
 +
=== Firefox ===
 +
To stop firefox from acting on middle mouse clicks, set the following options in {{ic|about:config}}.
 +
{{hc|about:config|
 +
middlemouse.contentLoadURL false
 +
middlemouse.paste false
 +
}}
 +
 
 +
=== GTK ===
 +
{{hc|.config/gtk-3.0|<nowiki>
 +
gtk-enable-primary-paste=false
 +
</nowiki>}}
  
Of the three selections, users should only be concerned with PRIMARY and CLIPBOARD. SECONDARY is only used inconsistently and was intended as an alternate to PRIMARY. Different applications may treat PRIMARY and CLIPBOARD differently; however, there is a degree of consensus that CLIPBOARD should be used for Windows-style clipboard operations, while PRIMARY should exist as a "quick" option, where text can be selected using the mouse or keyboard, then pasted using the middle mouse button (or some emulation of it). This can cause confusion and, in some cases, inconsistent or undesirable results from rogue applications.
+
== List of clipboard managers ==
  
==Clipboard Managers==
+
Clipboard managers are applications that enable users to manipulate the clipboard. Note that many of these programs can also synchronize the previously mentioned clipboards.
There is a variety of clipboard managers available, and several desktop environments come with their own clipboard manager or have a clipboard manager intended for them ([http://glipper.sourceforge.net/ Glipper] for [[GNOME]] and [http://goodies.xfce.org/projects/panel-plugins/xfce4-clipman-plugin Clipman] for [[Xfce]]); however, there are several DE-agnostic clipboard managers such as [http://parcellite.sourceforge.net/ Parcellite] (GTK+) and [http://www.nongnu.org/autocutsel/ autocutsel] (command-line), both of which are available in [community] and can be run as daemons.
+
  
==Resources==
+
* {{App|Anamnesis|Clipboard manager that stores all the clipboard history and offers an interface to do a full-text search. It has both a command line and GUI mode available.|http://anamnesis.sourceforge.net/|{{AUR|anamnesis}}}}
 +
* {{App|Autocutsel|Command line and daemon interfaces to synchronize PRIMARY, {{Ic|CLIPBOARD}} and cut buffer selections.|http://www.nongnu.org/autocutsel/|{{Pkg|autocutsel}}}}
 +
* {{App|Clipboard Indicator|Clipboard manager extension for GNOME Shell. Adds a clipboard indicator to the top panel, and caches clipboard history.|https://extensions.gnome.org/extension/779/clipboard-indicator/|https://github.com/Tudmotu/gnome-shell-extension-clipboard-indicator}}
 +
* {{App|ClipIt|Fork of Parcellite.|http://sourceforge.net/projects/gtkclipit/|{{AUR|clipit}}}}
 +
* {{App|Clipman|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.|http://goodies.xfce.org/projects/panel-plugins/xfce4-clipman-plugin|{{Pkg|xfce4-clipman-plugin}}}}
 +
* {{App|Clipmenu|Dmenu based clipboard manager|https://github.com/cdown/clipmenu/|{{AUR|clipmenu}}}}
 +
* {{App|Clipster|A lightweight, command-line-driven clipboard manager, written in Python.|https://github.com/mrichar1/clipster|{{AUR|clipster-git}}}}
 +
* {{App|CopyQ|Clever clipboard manager with searchable and editable history, custom actions on items and command line support.|https://github.com/hluk/CopyQ|{{AUR|copyq}}}}
 +
* {{App|[[Wikipedia:Glipper|Glipper]]|Clipboard manager for the GNOME desktop with many features and plugin support.|https://launchpad.net/glipper|{{AUR|glipper}}}}
 +
* {{App|GPaste|Clipboard management system that aims at being a new generation Parcellite, with a modular structure split in a couple of libraries and a daemon for adaptability. Offers a GNOME Shell extension and a CLI interface.|https://github.com/Keruspe/GPaste|{{Pkg|gpaste}}}}
 +
* {{App|Keepboard|Cross-platform clipboard manager. Saves text, image and file clipboard items. |http://sourceforge.net/projects/keepboard/|}}
 +
* {{App|[[Wikipedia:Klipper|Klipper]]|Full featured clipboard manager for the KDE desktop.|http://userbase.kde.org/Klipper|{{Pkg|plasma-workspace}}}}
 +
* {{App|Parcellite|Lightweight yet feature-rich clipboard manager.|http://parcellite.sourceforge.net/|{{Pkg|parcellite}}}}
 +
* {{App|Pasteall|Clipboard monitor simple and functional(with notifications in Portugese).|https://github.com/LaraCraft93/Pasteall|{{AUR|pasteall}}}}
 +
* {{App|Qlipper|Lightweight and cross-platform clipboard history applet based on Qt.|https://github.com/pvanek/qlipper/|{{AUR|qlipper}}}}
 +
* {{App|Xclip|A lightweight, command-line based interface to the clipboard.|https://github.com/astrand/xclip|{{Pkg|xclip}}}}
 +
* {{App|xcmenu|Clipboard synchronizer developed for window manager users.|https://github.com/Cloudef/xcmenu|{{AUR|xcmenu-git}}{{Broken package link|{{aur-mirror|xcmenu-git}}}}}}
 +
* {{App|xsel|Command-line program for getting and setting the contents of the X selection.|http://www.vergenet.net/~conrad/software/xsel/|{{Pkg|xsel}}}}
  
*[http://standards.freedesktop.org/clipboards-spec/clipboards-latest.txt Cut-and-paste in X]
+
== See also ==
  
*[http://www.jwz.org/doc/x-cut-and-paste.html X Selections, Cut Buffers, and Kill Rings.]
+
* [http://standards.freedesktop.org/clipboards-spec/clipboards-latest.txt Cut-and-paste in X]
 +
* [http://www.jwz.org/doc/x-cut-and-paste.html X Selections, Cut Buffers, and Kill Rings.]

Latest revision as of 16:08, 21 January 2017

From Wikipedia:Clipboard (computing):

The clipboard is a facility used for short-term data storage and/or data transfer between documents or applications, via copy and paste operations.

History

In X10, "cut buffers" were introduced. These were limited buffers that stored arbitrary text and were used by most applications. However, they were inefficient and implementation of them varied, so selections were introduced. Cut buffers are long deprecated, and although some applications (such as xterm) may have legacy support for them, it is both not likely and not recommended that they be used.

Background

The ICCCM (Inter-Client Communication Conventions Manual) standard defines three "selections": PRIMARY, SECONDARY, and CLIPBOARD. Despite the naming, all three are basically "clipboards". Rather than the old "cut buffers" system where arbitrary applications could modify data stored in the cut buffers, only one application may control or "own" a selection at one time. This prevents inconsistencies in the operation of the selections. However, in some cases, this can produce strange outcomes, such as a bidirectional shared clipboard with Windows (which uses a single-clipboard system) in a virtual machine.

Of the three selections, users should only be concerned with PRIMARY and CLIPBOARD. SECONDARY is only used inconsistently and was intended as an alternate to PRIMARY. When some applications treat PRIMARY and CLIPBOARD differently, this can cause confusion and, in some cases, inconsistent or undesirable results, but the majority of applications shows the behaviour detailed in the next section.

How to use the selections (clipboards)

Tango-inaccurate.pngThe factual accuracy of this article or section is disputed.Tango-inaccurate.png

Reason: Shortcuts and usage are application-specific (even synchronization is possible with a clipboard manager), nothing is copied anywhere until it is pasted (unless clipboard manager is used). (Discuss in Talk:Clipboard#)

There are two common selections (clipboards), which can have different values stored in them. Synchronization of both is possible with clipboard managers.

The CLIPBOARD selection is accessed using keyboard shortcuts, while application specific, these are most commonly ctrl+c for copying, ctrl+v for pasting and ctlr+x for cutting.

The PRIMARY selection speeds up the copying task by copying the text to the clipboard as soon as it was selected with the mouse, without the need for entering a keyboard shortcut. Pasting is triggered by pressing the middle mouse button (or some emulation of it).

Note: The clipboard may also contain other items than text, such as images or folders.

Application specific notes

Konsole terminal

The konsole terminal allows to use the shortcut ctl+c both for copying text and for stopping commands. The behaviour depends on whether there is something selected or not.

CLIPBOARD in Gvim

See Vim#Clipboard_.28gvim.29.

Disable paste on middle mouse click

Currently the only simple way to completely disable pasting with the middle mouse button across all applications is to disable the middle mouse button, which then also loses its other functions such as closing tabs. The applications listed below have specific settings to disable it.

Firefox

To stop firefox from acting on middle mouse clicks, set the following options in about:config.

about:config
middlemouse.contentLoadURL false
middlemouse.paste false

GTK

.config/gtk-3.0
gtk-enable-primary-paste=false

List of clipboard managers

Clipboard managers are applications that enable users to manipulate the clipboard. Note that many of these programs can also synchronize the previously mentioned clipboards.

  • Anamnesis — Clipboard manager that stores all the clipboard history and offers an interface to do a full-text search. It has both a command line and GUI mode available.
http://anamnesis.sourceforge.net/ || anamnesisAUR
  • Autocutsel — Command line and daemon interfaces to synchronize PRIMARY, CLIPBOARD and cut buffer selections.
http://www.nongnu.org/autocutsel/ || autocutsel
  • Clipboard Indicator — Clipboard manager extension for GNOME Shell. Adds a clipboard indicator to the top panel, and caches clipboard history.
https://extensions.gnome.org/extension/779/clipboard-indicator/ || https://github.com/Tudmotu/gnome-shell-extension-clipboard-indicator
  • ClipIt — Fork of Parcellite.
http://sourceforge.net/projects/gtkclipit/ || clipitAUR
  • Clipman — 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.
http://goodies.xfce.org/projects/panel-plugins/xfce4-clipman-plugin || xfce4-clipman-plugin
  • Clipmenu — Dmenu based clipboard manager
https://github.com/cdown/clipmenu/ || clipmenuAUR
  • Clipster — A lightweight, command-line-driven clipboard manager, written in Python.
https://github.com/mrichar1/clipster || clipster-gitAUR
  • CopyQ — Clever clipboard manager with searchable and editable history, custom actions on items and command line support.
https://github.com/hluk/CopyQ || copyqAUR
  • Glipper — Clipboard manager for the GNOME desktop with many features and plugin support.
https://launchpad.net/glipper || glipperAUR
  • GPaste — Clipboard management system that aims at being a new generation Parcellite, with a modular structure split in a couple of libraries and a daemon for adaptability. Offers a GNOME Shell extension and a CLI interface.
https://github.com/Keruspe/GPaste || gpaste
  • Keepboard — Cross-platform clipboard manager. Saves text, image and file clipboard items.
http://sourceforge.net/projects/keepboard/ ||
  • Klipper — Full featured clipboard manager for the KDE desktop.
http://userbase.kde.org/Klipper || plasma-workspace
  • Parcellite — Lightweight yet feature-rich clipboard manager.
http://parcellite.sourceforge.net/ || parcellite
  • Pasteall — Clipboard monitor simple and functional(with notifications in Portugese).
https://github.com/LaraCraft93/Pasteall || pasteallAUR
  • Qlipper — Lightweight and cross-platform clipboard history applet based on Qt.
https://github.com/pvanek/qlipper/ || qlipperAUR
  • Xclip — A lightweight, command-line based interface to the clipboard.
https://github.com/astrand/xclip || xclip
  • xcmenu — Clipboard synchronizer developed for window manager users.
https://github.com/Cloudef/xcmenu || xcmenu-gitAUR[broken link: archived in aur-mirror]
  • xsel — Command-line program for getting and setting the contents of the X selection.
http://www.vergenet.net/~conrad/software/xsel/ || xsel

See also