Is it possible to know the source (application) of the clipboard?
11
votes
1
answer
1358
views
I've noticed that sometimes clipboard contents become unavailable if the source application (where the content was copied from) is closed.
This leads me to wonder if it's possible to know what the source application is (e.g. perhaps by PID).
Why? If the source application is a terminal, I'd like to find the working directory of the terminal, in case the copied contents is a relative path, to construct a full path to a file.
FYI, I'm currently using xclip to determine the clipboard contents, e.g.
xclip -selection primary -t STRING -o 2> /dev/null
Asked by Jeff Ward
(693 rep)
Jun 22, 2015, 08:09 PM
Last activity: Aug 14, 2023, 02:07 AM
Last activity: Aug 14, 2023, 02:07 AM