kfish / xsel

A command-line program for getting and setting the contents of the X selection

Home Page:http://www.kfish.org/software/xsel/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bindings to languages?

opened this issue · comments

Hello,

Does anyone know if there are bindings available in other languages?

I am considering adding ruby bindings; I know ruby very well, but only very little C. Ideally I'd love to avoid duplicating work here in the event someone else has already done so.

More generally though, does anyone know of any language bindings towards xsel?

xsel is not really written as a library. Ideally you'd want to implement X selection getting and setting via a language's stream/range/iteratee abstraction. You could take the code from xsel to help with this, but you'd really want to eg. handle INCR transfers lazily.

For general hacks though, it should suffice to just make a small class that wraps calls to system("xsel -i") and system("xsel -o")