Commits

wodny committed 74158fe

pyclip

Comments (0)

Files changed (1)

+#!/usr/bin/python
+
+import gtk
+import sys
+
+def cget(clipboard, selectiondata, info, data):
+    selectiondata.set_text(data)
+
+def cclear(clipboard, data):
+    gtk.main_quit()
+
+text = sys.stdin.read()
+clipboard = gtk.clipboard_get(gtk.gdk.SELECTION_PRIMARY)
+clipboard.set_with_data((("UTF8_STRING", 0, 0),), cget, cclear, text)
+gtk.main()