Git Product home page Git Product logo

wl-clipboard's Introduction

wl-clipboard: Wayland clipboard utilities

This project implements two command-line 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.

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

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

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

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

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

# Sort clipboard contents:
$ wl-paste | sort | wl-copy

# Upload clipboard contents to a pastebin on each change:
$ wl-paste --watch nc paste.example.org 5555

Please see the wl-clipboard(1) man page for more details.

Installing

wl-clipboard is likely available in your favorite Linux or BSD distro. For building from source, see BUILDING.md.

License

wl-clipboard is free software, available under the GNU General Public License version 3 or later.

Related projects

  • wl-clipboard-x11: A wrapper to use wl-clipboard as a drop-in replacement to X11 clipboard tools.
  • wl-clipboard-rs: A Rust crate (library) for working with the Wayland clipboard which includes a reimplementation of wl-copy and wl-paste.

wl-clipboard's People

Contributors

ainola avatar artsymacaw avatar artturin avatar bugaevc avatar dnkl avatar ferdi265 avatar flooxo avatar kode54 avatar lcandeago avatar lukaslihotzki avatar mahkoh avatar maxice8 avatar nt8r avatar oxalica avatar remexre avatar seirdy avatar tristan957 avatar yalter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wl-clipboard's Issues

wl-paste hangs with qtwayland clipboard

When trying to paste the clipboard from a qtwayland application (qutebrowser in this case), wl-paste hangs for around 1 minute before finally pasting the copied string:

[3309200.309]  -> [email protected]_registry(new id wl_registry@2)
[3309200.355]  -> [email protected](new id wl_callback@3)
[3309200.455] [email protected]_id(3)
[3309200.471] [email protected](1, "wl_shm", 1)
[3309200.498]  -> [email protected](1, "wl_shm", 1, new id [unknown]@4)
[3309200.525] [email protected](2, "zwp_linux_dmabuf_v1", 3)
[3309200.547] [email protected](3, "wl_drm", 2)
[3309200.570] [email protected](4, "wl_compositor", 4)
[3309200.595]  -> [email protected](4, "wl_compositor", 3, new id [unknown]@5)
[3309200.630] [email protected](5, "wl_subcompositor", 1)
[3309200.662] [email protected](6, "wl_data_device_manager", 3)
[3309200.682]  -> [email protected](6, "wl_data_device_manager", 1, new id [unknown]@6)
[3309200.711] [email protected](7, "gamma_control_manager", 1)
[3309200.729] [email protected](8, "zwlr_gamma_control_manager_v1", 1)
[3309200.750] [email protected](9, "gtk_primary_selection_device_manager", 1)
[3309200.768]  -> [email protected](9, "gtk_primary_selection_device_manager", 1, new id [unknown]@7)
[3309200.800] [email protected](10, "zxdg_output_manager_v1", 2)
[3309200.821] [email protected](11, "org_kde_kwin_idle", 1)
[3309200.851] [email protected](12, "zwp_idle_inhibit_manager_v1", 1)
[3309200.879] [email protected](13, "zwlr_layer_shell_v1", 1)
[3309200.902]  -> [email protected](13, "zwlr_layer_shell_v1", 1, new id [unknown]@8)
[3309200.936] [email protected](14, "zxdg_shell_v6", 1)
[3309200.962] [email protected](15, "xdg_wm_base", 2)
[3309200.988]  -> [email protected](15, "xdg_wm_base", 1, new id [unknown]@9)
[3309201.022] [email protected](16, "org_kde_kwin_server_decoration_manager", 1)
[3309201.044] [email protected](17, "zxdg_decoration_manager_v1", 1)
[3309201.068] [email protected](18, "zwp_relative_pointer_manager_v1", 1)
[3309201.092] [email protected](19, "zwp_pointer_constraints_v1", 1)
[3309201.118] [email protected](20, "wp_presentation", 1)
[3309201.143] [email protected](21, "zwlr_export_dmabuf_manager_v1", 1)
[3309201.168] [email protected](22, "zwlr_screencopy_manager_v1", 1)
[3309201.192] [email protected](23, "zwlr_data_control_manager_v1", 2)
[3309201.215]  -> [email protected](23, "zwlr_data_control_manager_v1", 1, new id [unknown]@10)
[3309201.254] [email protected](24, "zwp_primary_selection_device_manager_v1", 1)
[3309201.283]  -> [email protected](24, "zwp_primary_selection_device_manager_v1", 1, new id [unknown]@11)
[3309201.320] [email protected](25, "zwp_virtual_keyboard_manager_v1", 1)
[3309201.347] [email protected](26, "zwlr_input_inhibit_manager_v1", 1)
[3309201.374] [email protected](27, "wl_seat", 6)
[3309201.401]  -> [email protected](27, "wl_seat", 2, new id [unknown]@12)
[3309201.438] [email protected](28, "wl_output", 3)
[3309201.459] [email protected](29, "wl_output", 3)
[3309201.485] [email protected](48756)
[3309201.500]  -> [email protected]_data_device(new id wl_data_device@3, wl_seat@12)
[3309201.522]  -> [email protected]_device(new id gtk_primary_selection_device@13, wl_seat@12)
[3309201.544]  -> [email protected]_device(new id zwp_primary_selection_device_v1@14, wl_seat@12)
[3309201.564]  -> [email protected]_data_device(new id zwlr_data_control_device_v1@15, wl_seat@12)
[3309201.667] [email protected]("seat0")
[3309201.681] [email protected](3)
[3309201.697]  -> [email protected]_keyboard(new id wl_keyboard@16)
[3309201.714] [email protected]_offer(new id zwlr_data_control_offer_v1@1295112912)
[3309201.730] [email protected]("text/html")
[3309201.748] [email protected]("text/plain")
[3309201.760] [email protected]("text/plain;charset=utf-8")
[3309201.773] [email protected](zwlr_data_control_offer_v1@4278190080)
[3309201.800]  -> [email protected]("text/plain;charset=utf-8", fd 6)
[3309201.822]  -> [email protected](new id wl_callback@17)
[3309201.992] [email protected]_id(17)
[3309202.007] [email protected](1, fd 6, 50149)
[3309202.055] [email protected](48756)

<hangs here for a very long time>

TEST PASTE STRING

I'm using qtwayland 5.12.2

Term window briefly shrinks with wl-copy --primary

I first reported this to sway (swaywm/sway#3911), but was directed here. They said that:

This is a wl-clipboard bug. It's supposed to use the data-control protocol. Please report it to them with this log.

Here is the command and its debug log:

$ echo foo | wl-copy --primary
[395209.596]  -> [email protected]_registry(new id wl_registry@2)
[395209.629]  -> [email protected](new id wl_callback@3)
[395209.720] [email protected]_id(3)
[395209.732] [email protected](1, "wl_shm", 1)
[395209.752]  -> [email protected](1, "wl_shm", 1, new id [unknown]@4)
[395209.785] [email protected](2, "zwp_linux_dmabuf_v1", 3)
[395209.804] [email protected](3, "wl_drm", 2)
[395209.820] [email protected](4, "wl_compositor", 4)
[395209.834]  -> [email protected](4, "wl_compositor", 3, new id [unknown]@5)
[395209.866] [email protected](5, "wl_subcompositor", 1)
[395209.885] [email protected](6, "wl_data_device_manager", 3)
[395209.902]  -> [email protected](6, "wl_data_device_manager", 1, new id [unknown]@6)
[395209.933] [email protected](7, "gamma_control_manager", 1)
[395209.952] [email protected](8, "zwlr_gamma_control_manager_v1", 1)
[395209.969] [email protected](9, "gtk_primary_selection_device_manager", 1)
[395209.987]  -> [email protected](9, "gtk_primary_selection_device_manager", 1, new id [unknown]@7)
[395210.014] [email protected](10, "zxdg_output_manager_v1", 2)
[395210.043] [email protected](11, "org_kde_kwin_idle", 1)
[395210.060] [email protected](12, "zwp_idle_inhibit_manager_v1", 1)
[395210.081] [email protected](13, "zwlr_layer_shell_v1", 1)
[395210.102] [email protected](14, "zxdg_shell_v6", 1)
[395210.126] [email protected](15, "xdg_wm_base", 2)
[395210.149]  -> [email protected](15, "xdg_wm_base", 1, new id [unknown]@8)
[395210.179] [email protected](16, "org_kde_kwin_server_decoration_manager", 1)
[395210.214] [email protected](17, "zxdg_decoration_manager_v1", 1)
[395210.227] [email protected](18, "zwp_relative_pointer_manager_v1", 1)
[395210.244] [email protected](19, "zwp_pointer_constraints_v1", 1)
[395210.266] [email protected](20, "wp_presentation", 1)
[395210.285] [email protected](21, "zwlr_export_dmabuf_manager_v1", 1)
[395210.302] [email protected](22, "zwlr_screencopy_manager_v1", 1)
[395210.320] [email protected](23, "zwlr_data_control_manager_v1", 2)
[395210.337] [email protected](24, "zwp_virtual_keyboard_manager_v1", 1)
[395210.367] [email protected](25, "zwlr_input_inhibit_manager_v1", 1)
[395210.383] [email protected](26, "wl_seat", 6)
[395210.403]  -> [email protected](26, "wl_seat", 1, new id [unknown]@9)
[395210.428] [email protected](27, "wl_output", 3)
[395210.447] [email protected](28, "wl_output", 3)
[395210.467] [email protected](29, "wl_output", 3)
[395210.483] [email protected](1744)
[395210.491]  -> [email protected]_data_device(new id wl_data_device@3, wl_seat@9)
[395210.522]  -> [email protected]_device(new id gtk_primary_selection_device@10, wl_seat@9)
[395236.067]  -> [email protected]_source(new id gtk_primary_selection_source@11)
[395236.113]  -> [email protected]("text/plain")
[395236.118]  -> [email protected]("text/plain;charset=utf-8")
[395236.121]  -> [email protected]("TEXT")
[395236.125]  -> [email protected]("STRING")
[395236.129]  -> [email protected]("UTF8_STRING")
[395236.136]  -> [email protected]_surface(new id wl_surface@12)
[395236.147]  -> [email protected]_xdg_surface(new id xdg_surface@13, wl_surface@12)
[395236.169]  -> [email protected]_toplevel(new id xdg_toplevel@14)
[395236.179]  -> [email protected]_title("wl-clipboard")
[395236.204]  -> [email protected]()
[395236.211]  -> [email protected](new id wl_callback@15)
[395236.329] [email protected]_id(15)                                                                                                                                                                                                                                                                                                                                                                                                   
[395236.360] [email protected](3)
[395236.370]  -> [email protected]_keyboard(new id wl_keyboard@16)
[395236.382] [email protected](1746)
[395236.390]  -> [email protected](1746)
[395236.398] [email protected](1746)
[395236.407] [email protected](0, 0, array)
[395236.423] [email protected](1745)
[395236.432]  -> [email protected]_configure(1745)
[395236.451]  -> [email protected]_pool(new id wl_shm_pool@15, fd 5, 4)
[395236.474]  -> [email protected]_buffer(new id wl_buffer@17, 0, 1, 1, 4, 0)
[395236.502]  -> [email protected](wl_buffer@17, 0, 0)
[395236.519]  -> [email protected]()
[395237.068] [email protected](1, fd 5, 48475)
[395237.119] [email protected](1750, wl_surface@12, array)
[395237.135]  -> [email protected]_selection(gtk_primary_selection_source@11, 1750)
[395237.158]  -> [email protected](new id wl_callback@18)
[395237.168] [email protected](1751, 0, 0, 0, 0)
[395237.184] [email protected](1916, 2103, array)
[395237.192] [email protected](1747)
[395237.197]  -> [email protected]_configure(1747)
[395237.263] [email protected]_id(18)
[395237.270] [email protected](1751)
[395237.277]  -> [email protected]()
[395237.280]  -> [email protected]()
[395237.285]  -> [email protected]()
[395237.528] [email protected]_id(14)
[395237.536] [email protected]_id(13)
[395237.541] [email protected]_id(12)
[395237.547] [email protected](1753, nil)
[398320.063] [email protected]()

Cannot paste into XWayland programs

Some applications (notably chrome, firefox and vscode) can't paste wl-copy'ed input.

wl-paste itself works:

{ echo hello | wl-copy& } ; wl-paste
hello

But pasting into at least chrome, firefox and vscode does not work.

Note that the paste is in fact consumed (and wl-copy exits), it just comes out empty.

Other apps (gedit, libreoffice, the terminal) don't have the problem.

YAML is not considered a text format

When copying a yaml file with wl-copy <file.yml, the only detected MIME type (as reported by wl-paste -l) is application/x-yaml, but there are no text-compatible types, and therefore it's not possible to paste yaml files into text fields in my favourite browser.

wl-paste fails to infer the mime type

Currently, both wl-copy and wl-paste use xdg-mime to infer the mime type of a file being pasted to or copied. This makes perfect sense for wl-copy, but in case of wl-paste, the file is usually pre-truncated by the shell. So for example, when wl-paste is invoked like

$ wl-paste > image.png

the shell either creates an empty file or truncates the pre-existing one. And xdg-mime infers empty files to be plain text disregarding their extensions.

Explicitly specifying the correct mime type works:

$ wl-paste > image.png -t image/png

To fix this, we need to teach wl-paste to only look at the file's name, not its contents. The problem is, neither xdg-mime nor file/mimetype seem to support this.

I can only think of these options:

  • use libxdgmime
  • reimplement this functionality ourselves
  • try harder to convince file (or other existing tool) to only look at the file name

wl-copy from large XML file doesn't work in Chromium (GNOME Wayland session)

I can use wl-copy to copy and paste single or two line text from the command line arguments, but if I wl-copy the piped output of my /etc/fonts/local.conf, Chromium pastes nothing. wl-paste works normally with the resulting text. This may be a Chromium or XWayland issue, though.

E: It works if I do it like this:

wl-copy $(cat /etc/fonts/local.conf)

Using Arch package, version 1.0.0-4.

E3: Middle-click with -p argument doesn't work with pipe output, either.

Can't paste a PGP key copied with wl-copy

Hi,

Thanks for the package!

I have a small issue, unfortunately, with this command

gpg --export -a [email protected] | wl-copy

It does not work when i try to paste data.

However!, this works

echo "test" | wl-copy

FYI, its not related to fds, and i confirm i run wayland

$ echo $XDG_SESSION_TYPE
wayland

$ echo "test" 1>/dev/null
$ gpg --export -a [email protected] 1>/dev/null
$ echo "test" 2>/dev/null
test
$ gpg --export -a [email protected] 2>/dev/null
-----BEGIN PGP PUBLIC KEY BLOCK-----
... 

Clipboard history

Would it be possible/in scope to add support for a command wl-paste --list-history and wl-paste --get-history $num to access previous clipboard events?
I guess that it would need to run as a demon to catch them, though.

wl-paste relies on its surface stealing focus

On sway, whenever some surface is fullscreen, newly spawned surfaces aren't automatically focused. This results in wl-paste hanging until its surface is manually given focus by the user.

Double free

I'm experiencing a random, occasional double free error ("free(): double free detected in tcache") when running wl-paste every second from my clipman app.

I'm using wl-clipboard from master (commit c010972).

Lots of new warnings

I package wl-clipboard for Nix(OS) users. Recent builds are failing due to lots of new warnings.

I will look at patching them or tweaking my toolchain to ignore warnings.

I'm not well enough versed in C to know without deeper investigation if these are concerning warnings or not, so I decided to go ahead and open this.

these derivations will be built:
  /nix/store/fmdlscw7np352g7i0y42c0is31ys1zl6-wl-clipboard-60654b06da413fb244704fd3352a5447ed3921e3.drv
building '/nix/store/fmdlscw7np352g7i0y42c0is31ys1zl6-wl-clipboard-60654b06da413fb244704fd3352a5447ed3921e3.drv'...
unpacking sources
unpacking source archive /nix/store/fiibjrsaina16nmg7wx311sy14lp6cb9-source
source root is source
patching sources
configuring
meson flags: --buildtype=release         --libdir=/nix/store/gfacxzd6fcvx2fzs3qjkyqcva7sg3m87-wl-clipboard-60654b06da413fb244704fd3352a5447ed3921e3/lib --libexecdir=/nix/store/gfacxzd6fcvx2fzs3qjkyqcva7sg3m87-wl-clipboard-60654b06da413fb244704fd3352a5447ed3921e3/libexec         --bindir=/nix/store/gfacxzd6fcvx2fzs3qjkyqcva7sg3m87-wl-clipboard-60654b06da413fb244704fd3352a5447ed3921e3/bin --sbindir=/nix/store/gfacxzd6fcvx2fzs3qjkyqcva7sg3m87-wl-clipboard-60654b06da413fb244704fd3352a5447ed3921e3/sbin         --includedir=/nix/store/gfacxzd6fcvx2fzs3qjkyqcva7sg3m87-wl-clipboard-60654b06da413fb244704fd3352a5447ed3921e3/include         --mandir=/nix/store/gfacxzd6fcvx2fzs3qjkyqcva7sg3m87-wl-clipboard-60654b06da413fb244704fd3352a5447ed3921e3/share/man --infodir=/nix/store/gfacxzd6fcvx2fzs3qjkyqcva7sg3m87-wl-clipboard-60654b06da413fb244704fd3352a5447ed3921e3/share/info         --localedir=/nix/store/gfacxzd6fcvx2fzs3qjkyqcva7sg3m87-wl-clipboard-60654b06da413fb244704fd3352a5447ed3921e3/share/locale         -Dauto_features=disabled         --prefix=/nix/store/gfacxzd6fcvx2fzs3qjkyqcva7sg3m87-wl-clipboard-60654b06da413fb244704fd3352a5447ed3921e3
The Meson build system
Version: 0.49.0
Source dir: /build/source
Build dir: /build/source/build
Build type: native build
Project name: wl-clipboard
Project version: 1.0.0
Native C compiler: /nix/store/isg8rxaxkijl9x3hr2gzsf8pqfnqxg3k-gcc-wrapper-7.4.0/bin/cc (gcc 7.4.0 "gcc (GCC) 7.4.0")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Found pkg-config: /nix/store/4iij6zf2z7gx68rx3kg28xi5rqvnfja6-pkg-config-0.29.2/bin/pkg-config (0.29.2)
Dependency wayland-client found: YES 1.16.0
Program wayland-scanner found: YES (/nix/store/gwj1a8fi9cddk6cy87rw80rrvy0qg2qa-wayland-1.16.0/bin/wayland-scanner)
Dependency wayland-protocols found: YES 1.17
Header <sys/syscall.h> has symbol "SYS_memfd_create" : YES
Header <sys/mman.h> has symbol "SHM_ANON" : NO
Configuring config.h using configuration
Build targets in project: 18
Found ninja-1.8.2 at /nix/store/bybzm585krs0r9qza46jsp14b63wfa2i-ninja-1.8.2/bin/ninja
building
build flags: -j8 -l8
[1/26] Generating wp-primary-selection client header with a custom command.
[2/26] Generating wp-primary-selection code with a custom command.
[3/26] Generating wlr-layer-shell code with a custom command.
[4/26] Generating xdg-shell code with a custom command.
[5/26] Generating wlr-layer-shell client header with a custom command.
[6/26] Generating gtk-primary-selection client header with a custom command.
[7/26] Generating xdg-shell client header with a custom command.
[8/26] Generating gtk-primary-selection code with a custom command.
[9/26] Generating wlr-data-control client header with a custom command.
[10/26] Generating wlr-data-control code with a custom command.
[11/26] Compiling C object 'src/25a6634@@wp-primary-selection@sta/meson-generated_.._wp-primary-selection.c.o'.
[12/26] Compiling C object 'src/25a6634@@xdg-shell@sta/meson-generated_.._xdg-shell.c.o'.
[13/26] Linking static target src/libxdg-shell.a.
[14/26] Compiling C object 'src/25a6634@@wlr-layer-shell@sta/meson-generated_.._wlr-layer-shell.c.o'.
[15/26] Linking static target src/libwp-primary-selection.a.
[16/26] Compiling C object 'src/25a6634@@gtk-primary-selection@sta/meson-generated_.._gtk-primary-selection.c.o'.
[17/26] Linking static target src/libwlr-layer-shell.a.
[18/26] Linking static target src/libgtk-primary-selection.a.
[19/26] Compiling C object 'src/25a6634@@wlr-data-control@sta/meson-generated_.._wlr-data-control.c.o'.
[20/26] Linking static target src/libwlr-data-control.a.
[21/26] Compiling C object 'src/25a6634@@wl-clipboard-boilerplate@sta/boilerplate.c.o'.
FAILED: src/25a6634@@wl-clipboard-boilerplate@sta/boilerplate.c.o
/nix/store/isg8rxaxkijl9x3hr2gzsf8pqfnqxg3k-gcc-wrapper-7.4.0/bin/cc -Isrc/25a6634@@wl-clipboard-boilerplate@sta -Isrc -I../src -I/nix/store/gwj1a8fi9cddk6cy87rw80rrvy0qg2qa-wayland-1.16.0/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O3 -fPIC  -MD -MQ 'src/25a6634@@wl-clipboard-boilerplate@sta/boilerplate.c.o' -MF 'src/25a6634@@wl-clipboard-boilerplate@sta/boilerplate.c.o.d' -o 'src/25a6634@@wl-clipboard-boilerplate@sta/boilerplate.c.o' -c ../src/boilerplate.c
../src/boilerplate.c: In function 'create_anonymous_file':
../src/boilerplate.c:463:12: warning: implicit declaration of function 'syscall'; did you mean 'strcoll'? [-Wimplicit-function-declaration]
     return syscall(SYS_memfd_create, "buffer", 0);
            ^~~~~~~
            strcoll
../src/boilerplate.c:468:12: warning: implicit declaration of function 'fileno'; did you mean 'mblen'? [-Wimplicit-function-declaration]
     return fileno(tmpfile());
            ^~~~~~
            mblen
../src/boilerplate.c: In function 'popup_tiny_invisible_surface':
../src/boilerplate.c:547:5: warning: implicit declaration of function 'ftruncate'; did you mean 'strncat'? [-Wimplicit-function-declaration]
     ftruncate(fd, size);
     ^~~~~~~~~
     strncat
../src/boilerplate.c: In function 'infer_mime_type_from_contents':
../src/boilerplate.c:675:28: error: 'PATH_MAX' undeclared (first use in this function); did you mean 'INT8_MAX'?
         char *res = malloc(PATH_MAX + 1);
                            ^~~~~~~~
                            INT8_MAX
../src/boilerplate.c:675:28: note: each undeclared identifier is reported only once for each function it appears in
../src/boilerplate.c: In function 'infer_mime_type_from_name':
../src/boilerplate.c:735:24: warning: implicit declaration of function 'strdup'; did you mean 'strcmp'? [-Wimplicit-function-declaration]
                 return strdup(mime_type);
                        ^~~~~~
                        strcmp
../src/boilerplate.c:735:24: warning: return makes pointer from integer without a cast [-Wint-conversion]
                 return strdup(mime_type);
                        ^~~~~~~~~~~~~~~~~
../src/boilerplate.c: In function 'dump_stdin_into_a_temp_file':
../src/boilerplate.c:746:9: warning: implicit declaration of function 'mkdtemp' [-Wimplicit-function-declaration]
     if (mkdtemp(dirpath) != dirpath) {
         ^~~~~~~
../src/boilerplate.c:746:26: warning: comparison between pointer and integer
     if (mkdtemp(dirpath) != dirpath) {
                          ^~
../src/boilerplate.c:752:29: error: 'PATH_MAX' undeclared (first use in this function); did you mean 'INT8_MAX'?
     char *res_path = malloc(PATH_MAX + 1);
                             ^~~~~~~~
                             INT8_MAX
../src/boilerplate.c: In function 'infer_mime_type_from_contents':
../src/boilerplate.c:659:5: warning: ignoring return value of 'pipe', declared with attribute warn_unused_result [-Wunused-result]
     pipe(pipefd);
     ^~~~~~~~~~~~
[22/26] Compiling C object 'src/25a6634@@wl-copy@exe/wl-copy.c.o'.
../src/wl-copy.c: In function 'do_send':
../src/wl-copy.c:41:19: warning: implicit declaration of function 'fdopen'; did you mean 'fopen'? [-Wimplicit-function-declaration]
         FILE *f = fdopen(fd, "w");
                   ^~~~~~
                   fopen
../src/wl-copy.c:41:19: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
../src/wl-copy.c: In function 'main':
../src/wl-copy.c:432:25: warning: implicit declaration of function 'strdup'; did you mean 'strcmp'? [-Wimplicit-function-declaration]
             mime_type = strdup(optarg);
                         ^~~~~~
                         strcmp
../src/wl-copy.c:432:23: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
             mime_type = strdup(optarg);
                       ^
../src/wl-copy.c:435:33: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
             requested_seat_name = strdup(optarg);
                                 ^
[23/26] Compiling C object 'src/25a6634@@wl-paste@exe/wl-paste.c.o'.
../src/wl-paste.c: In function 'do_process_offer':
../src/wl-paste.c:66:40: warning: implicit declaration of function 'strdup'; did you mean 'strcmp'? [-Wimplicit-function-declaration]
             available_types.any_text = strdup(offered_type);
                                        ^~~~~~
                                        strcmp
../src/wl-paste.c:66:38: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
             available_types.any_text = strdup(offered_type);
                                      ^
../src/wl-paste.c:69:33: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
             available_types.any = strdup(offered_type);
                                 ^
../src/wl-paste.c:76:55: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
             available_types.having_explicit_as_prefix = strdup(offered_type);
                                                       ^
../src/wl-paste.c: In function 'main':
../src/wl-paste.c:500:35: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
             options.explicit_type = strdup(optarg);
                                   ^
../src/wl-paste.c:503:33: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
             requested_seat_name = strdup(optarg);
                                 ^
../src/wl-paste.c: In function 'do_paste':
../src/wl-paste.c:178:5: warning: ignoring return value of 'pipe', declared with attribute warn_unused_result [-Wunused-result]
     pipe(pipefd);
     ^~~~~~~~~~~~
../src/wl-paste.c:199:9: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
         write(STDOUT_FILENO, "\n", 1);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
builder for '/nix/store/fmdlscw7np352g7i0y42c0is31ys1zl6-wl-clipboard-60654b06da413fb244704fd3352a5447ed3921e3.drv' failed with exit code 1
error: build of '/nix/store/fmdlscw7np352g7i0y42c0is31ys1zl6-wl-clipboard-60654b06da413fb244704fd3352a5447ed3921e3.drv' failed

Fails to build on GCC < 5 (-std=gnu89 by default)

Consider setting 'c_std=c99' or 'c_std=c11' in Meson's default_options instead of relying on implicit -std=gnu11 in GCC/Clang, which may change in future.

GCC 4.2 (default on FreeBSD powerpc*, mips*, riscv64, sparc64):

../src/boilerplate.c: In function 'infer_mime_type_from_name':
../src/boilerplate.c:718: error: 'for' loop initial declaration used outside C99 mode
../src/boilerplate.c:732: error: 'for' loop initial declaration used outside C99 mode

GCC 4.8.5:

../src/boilerplate.c: In function 'infer_mime_type_from_name':
../src/boilerplate.c:718:5: error: 'for' loop initial declarations are only allowed in C99 mode
     for (char line[200]; fgets(line, sizeof(line), f) != NULL;) {
     ^
../src/boilerplate.c:718:5: note: use option -std=c99 or -std=gnu99 to compile your code
../src/boilerplate.c:732:9: error: 'for' loop initial declarations are only allowed in C99 mode
         for (char ext[200]; sscanf(lineptr, "%s%n", ext, &consumed) == 1;) {
         ^

Fails to copy from a socket

I'm trying to interface this with (n)vim by adding an entry to this file:

https://github.com/neovim/neovim/blob/769d164c70bee1877d101447ba41730147a2f127/runtime/autoload/provider/clipboard.vim#L55-L110

I'm unable to get it to copy, however. It's failing with:

clipboard: error invoking wl-copy: cp: cannot open '/dev/stdin' for reading: No such device or address Failed to copy the file

The portion I've added is:

  elseif exists('$WAYLAND_DISPLAY') && executable('wl-copy') && executable('wl-paste')                                                                     
    let s:copy['+'] = 'wl-copy'                                                                                                                            
    let s:paste['+'] = 'wl-paste --no-newline'                                                                                                             
    let s:copy['*'] = 'wl-copy --primary'                                                                                                                  
    let s:paste['*'] = 'wl-paste --no-newline --primary'                                                                                                   
    return 'wl-copy'                                                                                                                                       

Issue branched off of #13

Write a man page

I think one man page for both tools will do. So far, the CLI is pretty simple, but as more options get added (explicitly specifying the mime type, using primary/DND clipboard...) it'll get complex enough to need a man page.

plain text files dropped into /tmp

So I noticed by accident that apparently wl-copy uses files of the format /tmp/wl-copy-buffer-[rand string]/stdin. That doesn't seem like a very safe thing to do when for example copying passwords. And actually it seems like those files are world-readable too.

primary selection

How can you make the primary selection by default make trim_newline?
Thank you

`wl-paste --primary` grabs keyboard maybe

say i'm using sway and i've got this loop

while :; do
    wl-paste --primary
    sleep 1
done

and that's running in a terminal emulator. then i open another and i hold down the f key for example in it. it will repeat (fffffffff...) but only for one second then it will stop. i release the key and try again. again only ~1s or less. now kill the loop and i can repeat all day long

i wasn't sure why this was happening but then i saw #12 and now i'm thinking maybe this is related?

my question is

  1. is this happening because wl-clipboard doesn't use wlr-data-control?
  2. is using wlr-data-control in the works? or maybe it's already done - but i'm stilling having this issue with master

thank you for your tool :D

wl-copy -c doesn't seem to work

$ย wl-copy hi
$ย wl-paste
hi
$ย wl-copy -c
$ย wl-paste
hi
$ย WAYLAND_DEBUG=1 wl-copy -c
[2922766.813]  -> [email protected]_registry(new id wl_registry@2)
[2922766.908]  -> [email protected](new id wl_callback@3)
[2922768.000] [email protected]_id(3)
[2922768.058] [email protected](1, "wl_drm", 2)
[2922768.103] [email protected](2, "wl_compositor", 4)
[2922768.186]  -> [email protected](2, "wl_compositor", 3, new id [unknown]@4)
[2922768.266] [email protected](3, "wl_shm", 1)
[2922768.316]  -> [email protected](3, "wl_shm", 1, new id [unknown]@5)
[2922768.421] [email protected](4, "wl_output", 2)
[2922768.476] [email protected](5, "zxdg_output_manager_v1", 1)
[2922768.515] [email protected](6, "wl_data_device_manager", 3)
[2922768.596]  -> [email protected](6, "wl_data_device_manager", 1, new id [unknown]@6)
[2922768.672] [email protected](7, "gtk_primary_selection_device_manager", 1)
[2922768.733]  -> [email protected](7, "gtk_primary_selection_device_manager", 1, new id [unknown]@7)
[2922768.813] [email protected](8, "wl_subcompositor", 1)
[2922768.865] [email protected](9, "xdg_wm_base", 2)
[2922768.913]  -> [email protected](9, "xdg_wm_base", 1, new id [unknown]@8)
[2922768.981] [email protected](10, "zxdg_shell_v6", 1)
[2922769.031] [email protected](11, "wl_shell", 1)
[2922769.077]  -> [email protected](11, "wl_shell", 1, new id [unknown]@9)
[2922769.142] [email protected](12, "gtk_shell1", 3)
[2922769.193] [email protected](13, "wp_viewporter", 1)
[2922769.245] [email protected](14, "zwp_pointer_gestures_v1", 1)
[2922769.288] [email protected](15, "zwp_tablet_manager_v2", 1)
[2922769.331] [email protected](16, "wl_seat", 5)
[2922769.403]  -> [email protected](16, "wl_seat", 2, new id [unknown]@10)
[2922769.467] [email protected](17, "zwp_relative_pointer_manager_v1", 1)
[2922769.510] [email protected](18, "zwp_pointer_constraints_v1", 1)
[2922769.552] [email protected](19, "zxdg_exporter_v1", 1)
[2922769.595] [email protected](20, "zxdg_importer_v1", 1)
[2922769.638] [email protected](21, "zwp_linux_dmabuf_v1", 3)
[2922769.681] [email protected](22, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[2922769.736] [email protected](23, "zwp_text_input_manager_v3", 1)
[2922769.778] [email protected](24, "gtk_text_input_manager", 1)
[2922769.822] [email protected](76549)
[2922769.848]  -> [email protected]_data_device(new id wl_data_device@3, wl_seat@10)
[2922769.896]  -> [email protected]_device(new id gtk_primary_selection_device@11, wl_seat@10)
[2922769.937]  -> [email protected]_data_source(new id wl_data_source@12)
[2922769.967]  -> [email protected]("text/plain")
[2922769.991]  -> [email protected]("text/plain;charset=utf-8")
[2922770.014]  -> [email protected]("TEXT")
[2922770.036]  -> [email protected]("STRING")
[2922770.058]  -> [email protected]("UTF8_STRING")
[2922770.086]  -> [email protected](new id wl_callback@13)
[2922770.408] [email protected]_id(13)
[2922770.439] [email protected](3)
[2922770.467]  -> [email protected]_keyboard(new id wl_keyboard@14)
[2922770.495] [email protected]("seat0")
[2922770.517] [email protected](76549)
[2922771.094] [email protected](1, fd 4, 55180)
[2922771.255]  -> [email protected]_surface(new id wl_surface@13)
[2922771.306]  -> [email protected]_shell_surface(new id wl_shell_surface@15, wl_surface@13)
[2922771.367]  -> [email protected]_toplevel()
[2922771.440]  -> [email protected]_title("wl-clipboard")
[2922771.538]  -> [email protected]_pool(new id wl_shm_pool@16, fd 5, 4)
[2922771.584]  -> [email protected]_buffer(new id wl_buffer@17, 0, 1, 1, 4, 0)
[2922771.677]  -> [email protected](wl_buffer@17, 0, 0)
[2922771.724]  -> [email protected](0, 0, 1, 1)
[2922771.788]  -> [email protected]()
[2922771.809]  -> [email protected](new id wl_callback@18)
[2922789.432] [email protected]_id(18)
[2922789.508] [email protected](76549)

Clearly it's not setting the new (fake) data source as the selection.

'No selection' is pasted in native Wayland applications.

I'm currently using wl-clipboard with wl-clipboard-x11, Sway, and Alacritty (native Wayland mode).

If I start a fresh Sway session and then paste using my configured keybind (Ctrl+Shift+V), the words No selection are pasted into the terminal. I would expect nothing to be pasted if the clipboard is empty.

This behaviour doesn't seem to happen with X11 applications running through Xwayland (Sublime Text is one example I tested with). If the clipboard is empty then nothing is pasted.

To fix this, I think this bail call should be removed:

bail("No selection");

If this is an appropriate fix then I can send a pull request.

Typo in man page

The command description in the wl-clipboard man page contains a typo.

wl-clipboard - Wayland copy and paste command line utiltites

Big deal, I know.

Create a release

Hi! Thanks for this great utility. I would like to package this for arch and would find it more convenient to use a blessed package version rather than rely on master.

Remove layer-shell support

A clipboard utility isn't supposed to use layer-shell. This will break when we implement security rules. layer-shell support should just be removed now that data-control-v1 has been merged in wlroots.

Don't exit `wl-copy` after one paste

Currently, if the clipboard is pasted (using Ctrl-V or wl-paste), wl-copy exits, and the clipboard content is no longer available.
It shouldn't exit until new content is copied from another application.

By the way, the current behavior (only providing one paste) is also cool, so it should have a command line option. It is useful for e.g. when using a password manager to copy password to clipboard. Passwords are usually pasted only once. Deleting the clipboard after pasting is usable to prevent accidentally pasting it to a chat or automatically saved HTML form. Currently, pass uses a time limit after which it will delete the clipboard content, but this is not a good solution. What if you have to wait for the application to start up before you can enter the password, and the clipboard times out? You have to copy it again. On the other hand, if you paste it immediately into the program, the clipboard is available for a few seconds after it, and you can accidentally paste it somewhere else.

2.0 release preparations

The big rewrite of wl-clipboard is done, merged and pushed into master, and we can go forward with the 2.0 release ๐ŸŽ‰

Before we cut a release though, let's give the 2.0 beta (the current master) some testing. I'm doing as much testing as I can myself, and it'd be great if you all could help me ๐Ÿ™‚

  • Packagers (@ainola, @adabru, @fsateler, @ddevault, @elmarco, @myfreeweb, @maxice8, @colemickens, @jbeich; did I forget anyone?), please check that you can build wl-clipboard 2.0 on your system without any problems. Please pay attention to what features (in particular which protocols) get enabled during the configuring stage โ€” the more, the better, but any configuration should work. Do you make some changes that you would like to upstream? I'm particularly interested in whether wl-clipboard still builds on BSD and non-glibc non-gcc systems.

  • Everybody, just test that it works and does what you'd expect. Do all sorts of copying and pasting; here are some ideas:

    • Check that wl-paste immediately after the compositor startup errors with No selection, and so does wl-paste --list-types
    • Try copying with wl-copy and pasting it back with wl-paste; are the contents identical? Do the -n (--no-newline/--trim-newline) flags work as expected? Try doing the same with --primary
    • Copy between wl-clipboard, Wayland apps and XWayland clients. Does it work? Does wl-copy -o still break pasting into XWayland clients?
    • If you have the hardware, please check that multiseat support (--seat) still works. Try asking for an invalid (or even empty) seat name, does it return an error correctly?
    • Does it work with binary data correctly? Can you copy an image into the primary clipboard and then paste it with middle click?
    • Does it work with non-UTF-8 text? Does pasting from and into Qt apps work?
    • Does it leave temp files in /tmp after all wl-copy processes exit? Does wl-copy -o clean up too?
    • Does type inference in wl-paste still work? Copy an image from a web page, observe wl-paste --list-types, then try pasting (to the terminal, to a text file, to a .png file, to a .jpg file...) and see if it does what it should. Try requesting a different type explicitly. Try requesting a generic type (e.g. --type image).
    • Do --clear and --paste-once work as expected? What about them in combination with --primary? Does clearing one clipboard mess with another?
    • If you use a wlroots-based compositor, does wl-paste --watch work? If you don't, does it report an error as it should?
    • Does bash completion work? Does it complete the correct currently available types after --type <TAB><TAB>? Does it correctly complete the nested command in say wl-paste -pw f<TAB>?
    • Copy a file from a file manager, see what MIME types it translates to. Try to replicate the same format with wl-copy; can you paste it back in the file manager?
    • Any combination of the above ๐Ÿ˜‰

Please report bugs as separate issues, and leave general comments here.

Known not to work:

  • wl-copy -c under Mutter 3.34, due to what seems to be a combination of three issues in Mutter, reported here.
  • wl-copy -c under Weston because it's being explicitly ignored.

Also cc @notramo, @Ferdi265, @emersion, @shmerl, @kode54, @brunelli, @YaLTeR, @bennydictor, @nostdm, @yory8, @szpak, @lovesegfault

[Feature request] Have wl-paste output a file instead of string

Hey, great piece of software, it makes Sway/wayland totally ready for every day use now! :-)

Is it possible to say to wl-paste that it should output a file, not a string of text?
If I do wl-copy < image.jpg a C-v outputs an image file just file, if I want to paste into Firefox or the GUI file manager.

Yet if I do wl-copy < text.txt a C-v just outputs the whole thing as a string of text. Will it be possible to specify e.g. via a flag that I want the file, not the string?

`rofi` hangs when executing wl-copy, and subsequently all other Xwayland applications hang

โฏ env WAYLAND_DEBUG=1 rofi -show test -modi 'test:wl-copy 123'
[199172.963]  -> [email protected]_registry(new id wl_registry@2)
[199172.993]  -> [email protected](new id wl_callback@3)
[199173.063] [email protected]_id(3)
[199173.070] [email protected](1, "wl_shm", 1)
[199173.081]  -> [email protected](1, "wl_shm", 1, new id [unknown]@4)
[199173.107] [email protected](2, "zwp_linux_dmabuf_v1", 3)
[199173.123] [email protected](3, "wl_drm", 2)
[199173.139] [email protected](4, "wl_compositor", 4)
[199173.167]  -> [email protected](4, "wl_compositor", 3, new id [unknown]@5)
[199173.182] [email protected](5, "wl_subcompositor", 1)
[199173.189] [email protected](6, "wl_data_device_manager", 3)
[199173.200]  -> [email protected](6, "wl_data_device_manager", 1, new id [unknown]@6)
[199173.211] [email protected](7, "gamma_control_manager", 1)
[199173.218] [email protected](8, "zwlr_gamma_control_manager_v1", 1)
[199173.232] [email protected](9, "gtk_primary_selection_device_manager", 1)
[199173.240]  -> [email protected](9, "gtk_primary_selection_device_manager", 1, new id [unknown]@7)
[199173.254] [email protected](10, "zxdg_output_manager_v1", 2)
[199173.263] [email protected](11, "org_kde_kwin_idle", 1)
[199173.276] [email protected](12, "zwp_idle_inhibit_manager_v1", 1)
[199173.284] [email protected](13, "zwlr_layer_shell_v1", 1)
[199173.298]  -> [email protected](13, "zwlr_layer_shell_v1", 1, new id [unknown]@8)
[199173.319] [email protected](14, "zxdg_shell_v6", 1)
[199173.328] [email protected](15, "xdg_wm_base", 2)
[199173.335]  -> [email protected](15, "xdg_wm_base", 1, new id [unknown]@9)
[199173.346] [email protected](16, "org_kde_kwin_server_decoration_manager", 1)
[199173.360] [email protected](17, "zxdg_decoration_manager_v1", 1)
[199173.370] [email protected](18, "zwp_relative_pointer_manager_v1", 1)
[199173.379] [email protected](19, "zwp_pointer_constraints_v1", 1)
[199173.385] [email protected](20, "wp_presentation", 1)
[199173.394] [email protected](21, "zwlr_export_dmabuf_manager_v1", 1)
[199173.405] [email protected](22, "zwlr_screencopy_manager_v1", 1)
[199173.416] [email protected](23, "zwlr_data_control_manager_v1", 1)
[199173.427]  -> [email protected](23, "zwlr_data_control_manager_v1", 1, new id [unknown]@10)
[199173.441] [email protected](24, "zwp_virtual_keyboard_manager_v1", 1)
[199173.450] [email protected](25, "zwlr_input_inhibit_manager_v1", 1)
[199173.460] [email protected](26, "wl_seat", 6)
[199173.470]  -> [email protected](26, "wl_seat", 2, new id [unknown]@11)
[199173.484] [email protected](28, "wl_output", 3)
[199173.492] [email protected](278287)
[199173.496]  -> [email protected]_data_device(new id wl_data_device@3, wl_seat@11)
[199173.509]  -> [email protected]_device(new id gtk_primary_selection_device@12, wl_seat@11)
[199173.518]  -> [email protected]_data_device(new id zwlr_data_control_device_v1@13, wl_seat@11)
[199173.668]  -> [email protected]_data_source(new id zwlr_data_control_source_v1@14)
[199173.727]  -> [email protected]("text/plain")
[199173.737]  -> [email protected]("text/plain;charset=utf-8")
[199173.747]  -> [email protected]("TEXT")
[199173.760]  -> [email protected]("STRING")
[199173.771]  -> [email protected]("UTF8_STRING")
[199173.784]  -> [email protected]_selection(zwlr_data_control_source_v1@14)
[199173.871] [email protected]("seat0")
[199173.893] [email protected](3)
[199173.909]  -> [email protected]_keyboard(new id wl_keyboard@15)
[199174.028] [email protected](1, fd 4, 48468)

During this time, Xwayland applications like firefox-nightly stop responding to input.

The same thing happens if I attempt to trigger wl-copy with tmux using a bind-key

sway version 1.0-beta.2-297-gaee99421 (Jan 30 2019, branch 'master')

wlroots was built on the same day as well.

Fedora package

Hi @elmarco, thanks for working on https://bugzilla.redhat.com/show_bug.cgi?id=1660440!

Please re-read https://github.com/bugaevc/wl-clipboard/blob/master/README.md#building โ€” wl-clipboard should have a Recommends: for xdg-utils and mailcap.

Is there a reason for packaging 7e5103c specifically? It would make sense to either package 1.0 stable or the latest master. There have been many fixes and improvements since 7e5103c (such as 195169e, 1d99c3d and 82fc39c). The next stable release is also happening soon (hopefully โ€” I've been saying this for two months and we're still not there), so maybe it makes sense to just wait for that.

Also please note that the self-description has changed a bit: 662b50c

wl-paste hangs after paste

I'm on Chrome OS 75 with Crostini and Ubuntu 18.04, with a freshly built copy of wl-clipboard. For some reason, wl-paste hangs after pasting and has to be exited with ^C:

wl-paste hangs

This does not appear to be normal behaviour. Have I hit an edge case?

1.1 release?

there have been quite a few changes since 1.0, it'd be nice to get a release if able.

wl-paste hanging in Konsole on Plasma wayland session

Should #19 be A-okay in version 1.0.0-4? I didn't want to raise a new ticket if it turns out it's the same issue but wl-paste is hanging for me in Konsole on Plasma with that version... Please bear with me I'm not so tech savvy and am entirely new to GitHub

WAYLAND_DEBUG=1 wl-paste
[2511762.336] -> [email protected]_registry(new id wl_registry@2)
[2511762.371] -> [email protected](new id wl_callback@3)
[2511762.603] [email protected]_id(3)
[2511762.631] [email protected](1, "wl_compositor", 3)
[2511762.648] -> [email protected](1, "wl_compositor", 3, new id [unknown]@4)
[2511762.672] [email protected](2, "wl_shell", 1)
[2511762.719] -> [email protected](2, "wl_shell", 1, new id [unknown]@5)
[2511762.752] [email protected](3, "xdg_shell", 1)
[2511762.770] [email protected](4, "zxdg_shell_v6", 1)
[2511762.790] [email protected](5, "xdg_wm_base", 1)
[2511762.815] -> [email protected](5, "xdg_wm_base", 1, new id [unknown]@6)
[2511762.851] [email protected](6, "zxdg_decoration_manager_v1", 1)
[2511762.876] [email protected](7, "wl_shm", 1)
[2511762.903] -> [email protected](7, "wl_shm", 1, new id [unknown]@7)
[2511762.945] [email protected](8, "wl_seat", 5)
[2511762.971] -> [email protected](8, "wl_seat", 1, new id [unknown]@8)
[2511763.004] [email protected](9, "zwp_pointer_gestures_v1", 1)
[2511763.028] [email protected](10, "zwp_pointer_constraints_v1", 1)
[2511763.050] [email protected](11, "wl_data_device_manager", 3)
[2511763.077] -> [email protected](11, "wl_data_device_manager", 1, new id [unknown]@9)
[2511763.112] [email protected](12, "org_kde_kwin_idle", 1)
[2511763.141] [email protected](13, "zwp_idle_inhibit_manager_v1", 1)
[2511763.170] [email protected](14, "org_kde_plasma_shell", 6)
[2511763.224] [email protected](15, "qt_surface_extension", 1)
[2511763.250] [email protected](16, "org_kde_kwin_appmenu_manager", 1)
[2511763.276] [email protected](17, "org_kde_kwin_server_decoration_palette_manager", 1)
[2511763.301] [email protected](18, "org_kde_plasma_window_management", 9)
[2511763.328] [email protected](19, "org_kde_plasma_virtual_desktop_management", 2)
[2511763.351] [email protected](20, "org_kde_kwin_shadow_manager", 2)
[2511763.373] [email protected](21, "org_kde_kwin_dpms_manager", 1)
[2511763.398] [email protected](22, "org_kde_kwin_server_decoration_manager", 1)
[2511763.425] [email protected](23, "org_kde_kwin_outputmanagement", 2)
[2511763.452] [email protected](24, "zxdg_output_manager_v1", 1)
[2511763.477] [email protected](25, "wl_subcompositor", 1)
[2511763.503] [email protected](26, "zxdg_exporter_v2", 1)
[2511763.526] [email protected](27, "zxdg_importer_v2", 1)
[2511763.553] [email protected](28, "zwp_relative_pointer_manager_v1", 1)
[2511763.576] [email protected](29, "org_kde_kwin_outputdevice", 2)
[2511763.603] [email protected](30, "wl_output", 3)
[2511763.631] [email protected](31, "wl_drm", 2)
[2511763.656] [email protected](32, "org_kde_kwin_remote_access_manager", 1)
[2511763.679] [email protected](33, "org_kde_kwin_fake_input", 3)
[2511763.704] [email protected](34, "org_kde_kwin_blur_manager", 1)
[2511763.729] [email protected](35, "org_kde_kwin_contrast_manager", 1)
[2511763.760] [email protected](36, "org_kde_kwin_slide_manager", 1)
[2511763.788] [email protected](19193)
[2511763.802] -> [email protected]_data_device(new id wl_data_device@3, wl_seat@8)
[2511763.827] -> [email protected]_surface(new id wl_surface@10)
[2511763.842] -> [email protected]_shell_surface(new id wl_shell_surface@11, wl_surface@10)
[2511763.863] -> [email protected]_toplevel()
[2511763.871] -> [email protected]_title("wl-clipboard")
[2511763.897] -> [email protected]_pool(new id wl_shm_pool@12, fd 5, 4)
[2511763.924] -> [email protected]_buffer(new id wl_buffer@13, 0, 1, 1, 4, 0)
[2511763.971] -> [email protected](wl_buffer@13, 0, 0)
[2511763.994] -> [email protected]()
[2511764.763] [email protected](7)
[2511764.797] -> [email protected]_keyboard(new id wl_keyboard@14)
[2511764.976] [email protected](1, fd 5, 50126)

Copying from stdin not working

Trying to copy with the following command is not working:
echo "test" | wl-copy

My specs:
Arch Linux
wl-clipboard r133.c010972-1
sway 1.2-2
wlroots 0.7.0-1
alacritty 0.3.3-3

EDIT: Fixed wl-clipboard version

Copying and pasting Unicode characters results in garbled characters

When copying and pasting text using wl-copy and wl-paste, Unicode characters are pasted in an incorrect way:

Behaviour

The character tested was "ร–" (U+00d6, the bytes 0xc3 and 0x96)

  • Wayland GTK to wl-paste: the text "\u00d6"
  • XWayland GTK to wl-paste: the byte 0xd6
  • Wayland QT to wl-paste: correct paste
  • XWayland QT to wl-paste: correct paste
  • wl-copy to Wayland QT: correct paste
  • wl-copy to XWayland GTK: the bytes 0xc3, 0x83, 0xc2, and 0x96 (U+00c3, U+0096, which is wrong)

A similar bug happened in Qt, first reported 2 years ago, still not fixed[1].

wl-copy insecurely retains copied text in /tmp after pasting with --paste-once

I'm not sure if it's an intended consequence, but after copying to the buffer using wl-copy --paste-once $TEXT, the copy/pasted string is retained as /tmp/wl-copy-buffer-wXXXX.

I suggest that following the paste of a string copied into the buffer with the --paste-once option, the buffer entry be deleted from /tmp.

The use case of this is for those using pass or lastpass-cli with wl-copy, their password is stored in cleartext in the buffer history in `/tmp'.

If it's not desirable to change the behaviour of --paste-once then it would be helpful to have a --secure-delete option to pass which will deleted the stored buffer from /tmp, or preferably, store the copied text in memory only.

Currently reproducible using wl-copy provided by wl-clipboard 1.0.0-4 on arch.

README

Please provide a README describing this project. It should also contain installation instructions, list of dependencies, usage instructions, etc.

Add support for type conversions

E.g. if we have text/html content and it gets pasted as text/plain, we may want to do the conversion somewhere in the middle (or not โ€” need an option to control this). If we have an image/jpeg, we should also advertise image/png and use some converter under the hood, and so on.

wl_display_dispatch: Broken pipe

  • latest beta

Launching wl-paste -t text --watch clipman store at sway startup, I get this (non-fatal) error: wl_display_dispatch: Broken pipe.

It seems to occur when starting a new sway session.

wl-copy / wl-paste don't work in Konsole (KWin Wayland session)

I was experimenting with wl-paste / wl-copy in KDE Konsole running in Wayland session. They don't seem to work at all.

I tried something simple:

   echo test | wl-copy
   wl-paste

The paste command is just hanging doing nothing. And it's not showing up in anything else as well when I'm trying Ctrl+V and such. Am I using it incorrectly, or something is wrong?

System: Current Debian testing, KDE Plasma 5.14.3, wl-clipboard 1.0.0.

wl-paste flashes a new terminal window before pasting clipboard contents

Platform: Arch Linux x86_64
Compositor: Sway version 1.0-rc1-37-gf5190d1f (Feb 8 2019, branch 'master')
Version (wl-clipboard): Pacman says 1.0 but there's no --version flag available (?)

Not sure if this is the intended behaviour but when running wl-paste it opens a new terminal window very briefly and then pastes the contents of the wayland clipboard to the original window where the command was invoked.

This is quite problematic in scripts as it keeps opening new windows whenever wl-paste is invoked.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.