Answer the question
In order to leave comments, you need to log in
Why can't I get data from the clipboard in linux?
I can't get the contents of the PRIMARY buffer, I do something like this:
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk
cb = Gtk.Clipboard.get(Gdk.SELECTION_PRIMARY)
print(cb)
<Gtk.Clipboard object at 0x7ff6031c1d38 (GtkClipboard at 0x27541b0)>
Answer the question
In order to leave comments, you need to log in
Ready. Understood. Sorry to bother you.
Works like this:
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_PRIMARY)
original = clipboard.wait_for_text()
print(original)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question