LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

wl-copy

Copy data to Wayland clipboard

TLDR

Copy text to the clipboard
$ wl-copy "[text]"
copy
Pipe command output to the clipboard
$ ls | wl-copy
copy
Copy for only one paste then clear
$ wl-copy --paste-once "[text]"
copy
Copy an image
$ wl-copy < [path/to/image]
copy
Copy sensitive data (e.g., a password) without clipboard history
$ wl-copy --sensitive "[password]"
copy
Set a specific MIME type
$ wl-copy --type text/html "[<b>bold</b>]"
copy
Clear the clipboard
$ wl-copy --clear
copy

SYNOPSIS

wl-copy [options] [text]

DESCRIPTION

wl-copy copies data to the Wayland clipboard. It can copy text from arguments or read binary data from stdin, automatically handling MIME types. The tool forks into the background by default to keep the clipboard contents available.Data can be piped into wl-copy for copying command output or file contents. It supports both the regular clipboard and the primary selection (for middle-click paste).

PARAMETERS

-o, --paste-once

Only serve one paste request then exit
-c, --clear
Clear the clipboard instead of copying
-p, --primary
Use the primary selection instead of clipboard
-n, --trim-newline
Do not append newline character
-t, --type mime-type
Set the MIME type for the content
-s, --seat seat
Pick the seat to work with
-f, --foreground
Stay in foreground instead of forking
--sensitive
Hint that content is sensitive (e.g., passwords); clipboard managers may avoid persisting it in history
-v, --version
Display version information
-h, --help
Display help message

INSTALL

sudo apt install wl-clipboard
copy
sudo dnf install wl-clipboard
copy
sudo pacman -S wl-clipboard
copy
sudo apk add wl-clipboard
copy
sudo zypper install wl-clipboard
copy
brew install wl-clipboard
copy
nix profile install nixpkgs#wl-clipboard
copy

CAVEATS

Only works under Wayland; use xclip or xsel for X11. The process must stay running (or fork) to serve paste requests. Clipboard contents are lost when wl-copy exits in foreground mode.

HISTORY

Part of wl-clipboard, written by Sergey Bugaev for Wayland-native clipboard access. Provides equivalent functionality to X11 tools like xclip and xsel but uses the Wayland clipboard protocol.

SEE ALSO

wl-paste(1), xclip(1), xsel(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid