Hi All,
Anyone know what the system calls are to write and read from the primary and secondary clipboards?
Many thanks, -T
On 1/25/20 3:40 PM, ToddAndMargo via users wrote:
Anyone know what the system calls are to write and read from the primary and secondary clipboards?
It's actually an X function call (or Wayland now). I would suggest looking at the code of "xsel" or "xclip" if you want details. Most higher level toolkits provide convenient wrappers for that.
On 2020-01-25 22:33, Samuel Sieb wrote:
On 1/25/20 3:40 PM, ToddAndMargo via users wrote:
Anyone know what the system calls are to write and read from the primary and secondary clipboards?
It's actually an X function call (or Wayland now). I would suggest looking at the code of "xsel" or "xclip" if you want details. Most higher level toolkits provide convenient wrappers for that.
I will look
Thank you
On 1/25/20 3:40 PM, ToddAndMargo via users wrote:
Anyone know what the system calls are to write and read from the primary and secondary clipboards?
It's not really that simple (and as Samuel pointed out, not a system call). Applications can set the clipboard contents to a list of data types that they can export their "copied" data as, so reading may mean connecting to the application that owns the clipboard, asking for a list of data types, selecting one that's supported, and then asking for that type specifically.
https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html
https://doc.qt.io/qt-5/qclipboard.html
https://www.uninformativ.de/blog/postings/2017-04-02/0/POSTING-en.html
On 2020-01-26 17:55, Gordon Messmer wrote:
On 1/25/20 3:40 PM, ToddAndMargo via users wrote:
Anyone know what the system calls are to write and read from the primary and secondary clipboards?
It's not really that simple (and as Samuel pointed out, not a system call). Applications can set the clipboard contents to a list of data types that they can export their "copied" data as, so reading may mean connecting to the application that owns the clipboard, asking for a list of data types, selecting one that's supported, and then asking for that type specifically.
https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html
I see what you mean!
:'(
https://doc.qt.io/qt-5/qclipboard.html
https://www.uninformativ.de/blog/postings/2017-04-02/0/POSTING-en.html
On 1/26/20 6:32 PM, ToddAndMargo via users wrote:
On 2020-01-26 17:55, Gordon Messmer wrote:
On 1/25/20 3:40 PM, ToddAndMargo via users wrote:
Anyone know what the system calls are to write and read from the primary and secondary clipboards?
It's not really that simple (and as Samuel pointed out, not a system call). Applications can set the clipboard contents to a list of data types that they can export their "copied" data as, so reading may mean connecting to the application that owns the clipboard, asking for a list of data types, selecting one that's supported, and then asking for that type specifically.
https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html
I see what you mean!
Why are you looking for this?
On 2020-01-26 18:43, Samuel Sieb wrote:
On 1/26/20 6:32 PM, ToddAndMargo via users wrote:
On 2020-01-26 17:55, Gordon Messmer wrote:
On 1/25/20 3:40 PM, ToddAndMargo via users wrote:
Anyone know what the system calls are to write and read from the primary and secondary clipboards?
It's not really that simple (and as Samuel pointed out, not a system call). Applications can set the clipboard contents to a list of data types that they can export their "copied" data as, so reading may mean connecting to the application that owns the clipboard, asking for a list of data types, selecting one that's supported, and then asking for that type specifically.
https://developer.gnome.org/gtk3/stable/gtk3-Clipboards.html
I see what you mean!
Why are you looking for this?
I adore Raku/perl6. Every so often I torture myself trying to use Raku's NativeCall to run system calls.
Currently I have a module that calls xclip. I thought it would be an interest exercise to go directly.
On 1/26/20 7:47 PM, ToddAndMargo via users wrote:
I adore Raku/perl6. Every so often I torture myself trying to use Raku's NativeCall to run system calls.
I haven't ported any perl5 modules to perl6, but in case that's your thing:
On 2020-01-26 22:11, Gordon Messmer wrote:
On 1/26/20 7:47 PM, ToddAndMargo via users wrote:
I adore Raku/perl6. Every so often I torture myself trying to use Raku's NativeCall to run system calls.
I haven't ported any perl5 modules to perl6, but in case that's your thing:
He is using xclip, same thing I used. Sweet!