View Single Post
Old 09-10-2023, 10:24 AM   #139
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,958
Karma: 6361444
Join Date: Nov 2009
Device: many
Here is the snippet from that plugin that does the work:
Code:
def CopyToClipboard(self, txt):
		"""
		Puts the text in txt on the clipboard
		Based on code from:
		https://www.programcreek.com/python/?CodeExample=copy+to+clipboard
		"""

		if platform.system() == 'Darwin':
			command = ["pbcopy"]
		elif platform.system() == 'Windows':
			command=["clip"]
		elif platform.system() == "Linux":
			command = ["xsel", "-b", "-i"]
Are you by chance using wayland instead of X11 on your linux box? If so, and if there is a wayland equivalent you could use instead, you might need to tweak these lines. From a google search I think wl-copy and or wl-clipboard might do what you want on wayland.

FWIW, wayland is not yet a choice I would make. Everytime I try it things break sometimes in horrible fashion. If I need to get real work done, turning off wayland on boot is the first thing I do. It is normally okay for playing around but not quite there yet.
Worse yet wayland's implementation varies by desktop chosen (kde vs ...) and so is non-standardized.




Quote:
Originally Posted by philja View Post
...
Looking at my OS clipboard, the plugin doesn't write anything there when I use the COPY function. I haven't been able to understand what I need to do to get it working. Help, please.

Last edited by KevinH; 09-10-2023 at 10:35 AM.
KevinH is offline   Reply With Quote