asweigart / pyperclip

Python module for cross-platform clipboard functions.
https://pypi.python.org/pypi/pyperclip
BSD 3-Clause "New" or "Revised" License
1.68k stars 198 forks source link

Klipper backend appears to fail silently on Plasma 6 + Wayland #258

Open afontenot opened 8 months ago

afontenot commented 8 months ago

On Arch Linux.

Distribution metadata says that plasma-workspace provides the klipper backend for pyperclip:

plasma-workspace: klipper backend [installed]

I have version 6.0.2 of plasma-workspace installed, and 1.8.2 of pyperclip.

pyperclip.copy("test")

Does not seem to do anything, with no other backends installed. If I install wl-clipboard, it works as expected. Is the Klipper API legacy / X11 only? If so I'd expect the backend to fail in pyperclip and receive an actionable error.

zhaozihanzzh commented 5 months ago

On my arch linux, my pyperclip also fails on plasma-workspace 6.1.0-1 and pyperclip 1.8.2. However, I'm using X11. I copied the newest master branch and tried again, but on calling paste(), it still gave me the following error:

Traceback (most recent call last):
  File "/home/zhaozihanzzh/clip/clip_test.py", line 3, in <module>
    input = cb.paste()
            ^^^^^^^^^^
  File "/home/zhaozihanzzh/clip/pyperclip/__init__.py", line 644, in lazy_load_stub_paste
    return paste()
           ^^^^^^^
  File "/home/zhaozihanzzh/clip/pyperclip/__init__.py", line 295, in __call__
    raise PyperclipException('Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs.io/en/latest/index.html#not-implemented-error' + additionalInfo)
pyperclip.PyperclipException: Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs.io/en/latest/index.html#not-implemented-error
On Linux, you can run `sudo apt-get install xclip` or `sudo apt-get install xselect` to install a copy/paste mechanism.

According to this post, it seems that klipper is a plasmashell applet now. So maybe the "klipper backend" is actually unusable, but the package maintainer in Arch Linux doesn't realize this point?