I've been trying to use pyperclip with the KDE desktop on Debian Sid, and copying to the clipboard is not working - the clipboard is cleared rather than containing the correct copied text.
By inserting some print statements in /usr/lib/python3/dist-packages/pyperclip/init.py I can see that the 'Setup for the LINUX platform:' code at line 580 is following the path to 'import gi'. If I comment out lines 582 - 594:
try:
import gi # check if gi is installed (for GTK+ 3)
except ImportError:
try:
import gtk # check if gtk is installed (fallback to GTK+ 2)
except ImportError:
pass # We want to fail fast for all non-ImportError exceptions.
else:
return init_gtk_clipboard()
else:
if gi.version_info[0] >= 3:
return init_gi_clipboard()
pass
then 'xclip' is called as the clipboard mechanism, and pyperclip functions correctly for me.
Is this a weird issue just for me, or does the code to select which clipboard system to use on Linux need some tweaking? Is the XDG_CURRENT_DESKTOP environment variable a way of distinguishing linux desktops?
I've been trying to use pyperclip with the KDE desktop on Debian Sid, and copying to the clipboard is not working - the clipboard is cleared rather than containing the correct copied text. By inserting some print statements in /usr/lib/python3/dist-packages/pyperclip/init.py I can see that the 'Setup for the LINUX platform:' code at line 580 is following the path to 'import gi'. If I comment out lines 582 - 594:
then 'xclip' is called as the clipboard mechanism, and pyperclip functions correctly for me. Is this a weird issue just for me, or does the code to select which clipboard system to use on Linux need some tweaking? Is the XDG_CURRENT_DESKTOP environment variable a way of distinguishing linux desktops?
The output of env on my desktop is: