Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/python
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
formats = '\n'.join([str(x) for x in clipboard.wait_for_targets()[1]])
print("Current clipboard offers formats: " + formats)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment