How to copy text to the clipboard when using Wayland?

mh-cbon

Is there a Wayland cli utility that copies text to clipboard?

I want to be able to do something like this:

echo "some" > clipboard

Something equivalent to xclip.

adabru

bugaevc's wl-clipboard are copy/paste utilities for Wayland:

This project implements two little Wayland clipboard utilities, wl-copy and wl-paste, that let you easily copy data between the clipboard and Unix pipes, sockets, files and so on.

Usage is as simple as:

# copy a simple text message
$ wl-copy Hello world!

# copy the list of files in Downloads
$ ls ~/Downloads | wl-copy

# copy an image file
$ wl-copy < ~/Pictures/photo.png

# paste to a file
$ wl-paste > clipboard.txt

# grep each pasted word in file source.c
$ for word in $(wl-paste); do grep $word source.c; done

# copy the previous command
$ wl-copy "!!"

# replace the current selection with the list of types it's offered in
$ wl-paste --list-types | wl-copy

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.

For all common linux-distributions the package-name is wl-clipboard, so use the command that suits yours (if not already installed):

sudo apt install wl-clipboard  # Debian
sudo yam install wl-clipboard  # Fedora
sudo pacman -S wl-clipboard    # Arch linux

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

how to copy selected text to the clipboard using javascript

From Dev

How can I copy text to the clipboard using AppleScript

From Dev

How to copy text including special characters to clipboard using C and WinAPI?

From Dev

How to copy text from command line to clipboard without using the mouse?

From Dev

How can I copy text to the clipboard using AppleScript

From Dev

How to copy text including special characters to clipboard using C and WinAPI?

From Dev

Automatic Copy to clipboard when deleting bunch of text

From Dev

Copy span text using Clipboard.js

From Dev

Using execCommand (Javascript) to copy hidden text to clipboard

From Dev

How to copy text from a div to clipboard

From Java

How to copy text to clipboard in Vaadin without addon

From Dev

How to copy text to / from clipboard in Go?

From Java

How to copy text to clipboard/pasteboard with Swift

From Dev

How Best to Copy Formatted Text Into Clipboard

From Dev

How to get content of a text file and copy it to clipboard?

From Dev

How can I copy the text of a Button in the clipboard?

From Dev

How to copy text from pentadactyl to system clipboard?

From Dev

How to copy text to Clipboard from TextField in Android

From Dev

How to copy data in a text file to the clipboard?

From Dev

How to copy a GIF to clipboard in Mac using python

From Dev

How to copy a selected word to the clipboard using VIM?

From Dev

Copy text to Clipboard in MFC

From Dev

Copy to clipboard as plain text

From Dev

copy text in clipboard

From Dev

Autoselect text with clipboard copy

From Dev

Copy text and html to clipboard

From Dev

Copy text js to clipboard

From Dev

How to copy one line from a text document to clipboard using command prompt

From Dev

How to copy data to clipboard when user selects "Copy" from ContextMenu

Related Related

  1. 1

    how to copy selected text to the clipboard using javascript

  2. 2

    How can I copy text to the clipboard using AppleScript

  3. 3

    How to copy text including special characters to clipboard using C and WinAPI?

  4. 4

    How to copy text from command line to clipboard without using the mouse?

  5. 5

    How can I copy text to the clipboard using AppleScript

  6. 6

    How to copy text including special characters to clipboard using C and WinAPI?

  7. 7

    Automatic Copy to clipboard when deleting bunch of text

  8. 8

    Copy span text using Clipboard.js

  9. 9

    Using execCommand (Javascript) to copy hidden text to clipboard

  10. 10

    How to copy text from a div to clipboard

  11. 11

    How to copy text to clipboard in Vaadin without addon

  12. 12

    How to copy text to / from clipboard in Go?

  13. 13

    How to copy text to clipboard/pasteboard with Swift

  14. 14

    How Best to Copy Formatted Text Into Clipboard

  15. 15

    How to get content of a text file and copy it to clipboard?

  16. 16

    How can I copy the text of a Button in the clipboard?

  17. 17

    How to copy text from pentadactyl to system clipboard?

  18. 18

    How to copy text to Clipboard from TextField in Android

  19. 19

    How to copy data in a text file to the clipboard?

  20. 20

    How to copy a GIF to clipboard in Mac using python

  21. 21

    How to copy a selected word to the clipboard using VIM?

  22. 22

    Copy text to Clipboard in MFC

  23. 23

    Copy to clipboard as plain text

  24. 24

    copy text in clipboard

  25. 25

    Autoselect text with clipboard copy

  26. 26

    Copy text and html to clipboard

  27. 27

    Copy text js to clipboard

  28. 28

    How to copy one line from a text document to clipboard using command prompt

  29. 29

    How to copy data to clipboard when user selects "Copy" from ContextMenu

HotTag

Archive