Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way in Linux-based operating systems to determine the source of text copied to the X clipboard?

Quick background info: I'm starting to build some software that will run within Gnome- and X-based operating systems to manage clipboard contents. One of the main functions will be to record the source URL of the copied text, if the copied text comes from a browser. I know this is possible on Windows (the Clipmate application does this), but I want to do this within Gnome/X.

I have a sneaking suspicion that this might not be possible, because there's no software on Gnu/Linux that comes close to matching the functionality of Clipmate. Any guidance would be greatly appreciated though.

like image 519
Ben Lacy Avatar asked Oct 10 '22 17:10

Ben Lacy


1 Answers

Intercept and decode the SetSelectionOwner X message.

like image 160
Ignacio Vazquez-Abrams Avatar answered Oct 14 '22 03:10

Ignacio Vazquez-Abrams