weadmonkey
weadmonkey

Reputation: 103

Xorg selection clip board

I've been struggling in the past 2 hours to find anything relevant to « selection » in the Xorg API documentation. I'm looking for a way to retrieve the content of the Xorg PRIMARY selection (or clipboard if you like.)

I found the header file /usr/include/X11/SelectionI.h but am unable to use it in any way.

Thanks for your help

Upvotes: 0

Views: 1087

Answers (1)

abarnert
abarnert

Reputation: 366123

If you have a specific question, and the manpages don't answer it, SO is a great resource. But if you just don't get it, look for a HOWTO.

If you want to learn how X11 selections work, see X Windows Copy-Paste mini HOWTO. This includes sample code that "every two seconds will notify us about the selected text in an application, if text is selected in any application", which sounds pretty close to what you want to do.

You should have the full Xlib documentation on your machine. If not, here's an HTML version.

And of course you should have the manpages for each function. If not, a google for, e.g., "man XGetSelectionOwner" will almost certainly give you various different HTML versions for most of the top hits.

However, if you're just learning X11, I would strongly recommend not learning Xlib; pick one of the higher-level libraries that wrap it up.

Upvotes: 1

Related Questions