This repository was archived by the owner on Mar 31, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
X11 clipboard management utilities
License
phillbush/xcliputils
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
XCLIPUTILS(1) General Commands Manual XCLIPUTILS(1) NAME xclipd, xclipin, xclipout, xselin, xselout, xclipowner, xselpowner, xclipwatch, xselwatch – X11 clipboard management utilities SYNOPSIS DISPLAY=display xclipd xclipin [target ...] [<file] xclipout [target ...] [>file] xclipowner xclipwatch xselin [target ...] [<file] xselout [target ...] [>file] xselowner xselwatch DESCRIPTION xclipd keeps the contents of the CLIPBOARD selection into both CLIPBOARD and PRIMARY selections (which are usually pasted with Ctrl-V and the middle mouse button, respectively). It allows the user to close a window without losing the copied data. It does not daemonize itself; therefore, it should be run in the background. xclipin and xselin read data from standard input and make it available on the CLIPBOARD and PRIMARY selections respectively, in the given targets. If no target argument is provided, they make selection available as common string targets (UTF8_STRING, STRING, etc). If the standard input is empty, the selection is cleaned. xclipout and xselout write to the standard output the content of the CLIPBOARD and PRIMARY selections respectively, in the first target supported by the selection owner. If no target argument is provided, they request selection in the UTF8_STRING target, if available (or the STRING target, otherwise). xclipowner and xselowner show information about the current owner of the CLIPBOARD and PRIMARY selections respectively, if any, as a single line of tab-separated values: • The first value is the timestamp of the ownership. • The second value is the ID of the window which owns the selection. • The remaining values, if any, are the supported targets. xclipwatch and xselwatch watch the CLIPBOARD and PRIMARY selections respectively, and print information about their owner as tab-separated values (see above) whenever ownership changes, one line per each ownership change. However, if the owner is the clipboard manager, it is ignored and no information is displayed for it. DIAGNOSTICS If the requested selection is not owned, xclipout, xselout, xclipowner, and xselowner return a non-zero exit status. If the requested selection can not be converted to any target, then xclipout and xselout write a diagnostic message to the standard error and return a non-zero exit status. Before the xclipin and xselin utilities exit, they fork a background process to communicate with requestors. But if an error occurs before the inter-process communication initiates, they exit non-zero and do not fork the background process. For all utilities, it is an error if the DISPLAY environment variable is not set to a valid display. EXAMPLES Read an JPEG file into the clipboard: $ xclipin image/jpeg </path/to/file.jpg Same as before, but use file(1) to guess the mimetype of the file: $ xclipin "$(file -ib /path/to/file.jpg)" </path/to/file.jpg Clean the clipboard: $ xclipin </dev/null Read a string to be pasted on middle mouse button: $ echo "Paste me!" | xselin Read a string output from a command into the primary selection, removing all leading and trailing space around it: $ cmd | awk 'NF{$1=$1;print}' | xselin Save STRING data from the clipboard into primary selection. (NOTE: the xclipd clipboard manager already does this for any target when run in the background): $ xclipout | xselin Write a JPEG image from the clipboard into a file: $ xclipout image/jpeg >/path/to/file.jpg List targets for the current clipboard selection (including meta-targets, like MULTIPLE and TIMESTAMP): $ xclipowner | cut -f3- Get the current owner of the primary selection: $ xselowner | cut -f2 SEE ALSO X(7) UNIX March 27, 2025 UNIX
About
X11 clipboard management utilities
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published