Commits

wodny committed 583ca28

Moved utils to utils

Comments (0)

Files changed (4)

pyclip-cutbuffer.py

-#!/usr/bin/python
-
-# Debugging:
-# $ xprop -root | grep CUT_BUFFER0
-# $ xclip -o -selection buffer-cut
-
-import gtk
-import sys
-
-text = sys.stdin.read()
-clipboard = gtk.clipboard_get(gtk.gdk.SELECTION_PRIMARY)
-clipboard.set_text("")
-clipboard.clear()
-gtk.gdk.screen_get_default().get_root_window().property_change("CUT_BUFFER0", "STRING", 8, gtk.gdk.PROP_MODE_REPLACE, text)
-gtk.gdk.screen_get_default().get_root_window().property_get("CUT_BUFFER0")

pyclip.py

-#!/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()

utils/pyclip-cutbuffer.py

+#!/usr/bin/python
+
+# Debugging:
+# $ xprop -root | grep CUT_BUFFER0
+# $ xclip -o -selection buffer-cut
+
+import gtk
+import sys
+
+text = sys.stdin.read()
+clipboard = gtk.clipboard_get(gtk.gdk.SELECTION_PRIMARY)
+clipboard.set_text("")
+clipboard.clear()
+gtk.gdk.screen_get_default().get_root_window().property_change("CUT_BUFFER0", "STRING", 8, gtk.gdk.PROP_MODE_REPLACE, text)
+gtk.gdk.screen_get_default().get_root_window().property_get("CUT_BUFFER0")
+#!/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()