xclipboard
Store and retrieve text to X clipboard
SYNOPSIS
xclipboard [toolkitoptions] [-option argument]
PARAMETERS
toolkitoptions
Standard X Toolkit command-line options are supported. These include options like -display, -geometry, -font, -fg (foreground), -bg (background), -bw (border width), -bd (border color), -name, -title, and -xrm.
-selection name
Specifies which X selection to use (e.g., PRIMARY or CLIPBOARD). Defaults to CLIPBOARD.
-w number_of_chars
Sets the width of the main window in characters.
-h number_of_lines
Sets the height of the main window in lines.
-e program
Executes the specified program whenever the selection changes. The selected text is available on the standard input of the executed program.
-c
Runs xclipboard in compact mode, suppressing scrolling and history, showing only the current selection.
-s
Specifies that selections should be saved persistently in the clipboard manager. This is the default behavior.
-nw
Prevents xclipboard from saving selections persistently.
DESCRIPTION
xclipboard is a venerable X Window System utility designed to manage and persist the X selection mechanism, primarily the CLIPBOARD selection. Unlike the PRIMARY selection which is transient and typically used for immediate copy-pasting via mouse selection, the CLIPBOARD selection is intended for more explicit copy/paste operations, often initiated by keyboard shortcuts (e.g., Ctrl+C/Ctrl+V).
When launched, xclipboard presents a window that displays the current content of the CLIPBOARD selection. It automatically updates this display when the selection changes, allowing users to visually inspect what has been copied. More importantly, xclipboard acts as a "selection owner," meaning it takes responsibility for holding the CLIPBOARD content, even if the original application that provided the content closes. This ensures that text or data remains available for pasting into other applications long after the source application has exited.
It also provides a history of previous CLIPBOARD contents, which can be navigated, allowing users to recall and paste older items. While it's a foundational tool, modern desktop environments often integrate more sophisticated clipboard managers, but xclipboard remains a robust, lightweight, and essential component for understanding and interacting with the core X clipboard functionality.
CAVEATS
While functional, xclipboard is a basic utility and may lack advanced features found in modern desktop environment-integrated clipboard managers, such as image support, synchronized clipboards across devices, or extensive history management beyond simple text.
Its interaction is primarily limited to the X Window System's selection mechanism, meaning it won't directly integrate with non-X applications (e.g., those using Wayland's clipboard protocol or native macOS/Windows clipboards). Users may find xclip or xsel more convenient for scripting clipboard interactions from the command line without a graphical interface.
X SELECTIONS AND CLIPBOARD
The X Window System defines multiple types of selections for inter-client communication, the most common being PRIMARY and CLIPBOARD. PRIMARY is typically used for highlight-and-paste (e.g., mouse middle-click paste), while CLIPBOARD is for explicit copy/paste operations (e.g., Ctrl+C/Ctrl+V). xclipboard primarily manages the CLIPBOARD selection, acting as a persistent owner. When an application copies data to the clipboard, xclipboard requests the selection ownership, stores the data, and then makes it available for other applications to paste, even after the original application has terminated.
This persistent ownership is crucial because, without a clipboard manager like xclipboard, the clipboard content would be lost if the application that "owned" the selection were to close. xclipboard's window allows users to view the current clipboard content and navigate through a history of copied items, effectively providing a multi-level clipboard.
HISTORY
xclipboard has been a fundamental part of the X Window System core distribution since its early days, serving as a reference implementation and practical tool for managing the X clipboard.
Its development parallels the evolution of Xlib and the X Toolkit Intrinsics (Xt), on which it is built. As one of the original X clients, it demonstrates the persistent nature of X selections and the concept of an "owner" for selection data, ensuring data availability even if the source application exits. Although more sophisticated clipboard managers have emerged with various desktop environments (like GNOME and KDE), xclipboard remains a lightweight and direct interface to the underlying X selection mechanism, often still found pre-installed on X-based systems.