Scroll to navigation

WL-CLIPBOARD(1) General Commands Manual WL-CLIPBOARD(1)

NAME

wl-clipboard - Wayland copy and paste command line utiltites

SYNOPSIS

wl-copy [--primary] [--paste-once] [--foreground] [--clear] [--type mime/type] [text...]

wl-paste [--primary] [--no-newline] [--list-types] [--type mime/type]

DESCRIPTION

wl-copy copies the given text to the Wayland clipboard. If no text is given, wl-copy copies data from its standard input.

wl-paste pastes data from the Wayland clipboard to its standard output.

Although wl-copy and wl-paste are particularly optimized for plain text and other textual content formats, they fully support content of arbitrary MIME types. wl-copy automatically infers the type of the copied content by running xdg-mime(1) on it. wl-paste tries its best to pick a type to paste based on the list of offered MIME types and the extension of the file it's pasting into. If you're not satisfied with the type they pick or don't want to rely on this implicit type inference, you can explicitly specify the type to use with the --type option.

OPTIONS

-p, --primary
Use the "primary" clipboard instead of the regular clipboard. This uses the private GTK+ primary selection protocol. See the GNOME Wiki page on primary selection under Wayland for more details.
-o, --paste-once
Only serve one paste request and then exit. Unless a clipboard manager specifically designed to prevent this is in use, this has the effect of clearing the clipboard after the first paste, which is useful for copying sensitive data such as passwords. Note that this may break pasting into some clients, in particular pasting into XWayland windows is known to break when this option is used.
-f, --foreground
By default, wl-copy forks and serves data requests in the background; this option overrides that behavior, causing wl-copy to run in the foreground.
-c, --clear
Instead of copying anything, clear the clipboard so that nothing is copied.
-n, --no-newline
Do not append a newline character after the pasted clipboard content. This option is automatically enabled for non-text content types.
-t mime/type, --type mime/type
Override the automatically selected MIME type. For wl-copy this option controls which type wl-copy will offer the content as. For wl-paste it controls which of the offered types wl-paste will request the content in. In addition to specific MIME types such as image/png, wl-paste also accepts generic type names such as text and image which make it automatically pick some offered MIME type that matches the given generic name.
-l, --list-types
Instead of pasting the selection, output the list of MIME types it is offered in.

ENVIRONMENT

WAYLAND_DISPLAY
Specifies what Wayland server wl-copy and wl-paste should connect to. This is the same environment variable that you pass to other Wayland clients, such as graphical aplications, that connect to this Wayland server. It is normally set up automatically by the graphical session and the Wayland compositor. See wl_display_connect(3) for more details.
WAYLAND_DEBUG
When set to 1, causes the wayland-client(7) library to log every interaction wl-copy and wl-paste make with the Wayland compositor to stderr.

EXAMPLES

$ wl-copy Hello world!

$ ls ~/Downloads | wl-copy

$ wl-copy < ~/Pictures/photo.png

$ wl-copy "!!"

$ wl-paste -n > clipboard.txt

$ wl-paste --list-types | wl-copy

SEE ALSO

xclip(1)
2018-10-03 wl-clipboard