merge in holizz uzbl_tabbed
authorDieter Plaetinck <dieter@plaetinck.be>
Tue, 9 Jun 2009 20:11:00 +0000 (22:11 +0200)
committerDieter Plaetinck <dieter@plaetinck.be>
Tue, 9 Jun 2009 20:11:00 +0000 (22:11 +0200)
AUTHORS
examples/data/uzbl/scripts/uzbl_tabbed.py [new file with mode: 0755]

diff --git a/AUTHORS b/AUTHORS
index 1253144..1873492 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -21,7 +21,7 @@ Contributors:
     Uli Schlachter (psychon) - basic mime_policy_cb & Makefile patch
     (uranther) - zoom level
     (bobpaul) - session script patches
-    Tom Adams (holizz) - few patches, cookies.py
+    Tom Adams (holizz) - few patches, cookies.py, gtkplugk/socket & uzbl_tabbed.py
     neutralinsomniac - load_progress = 0 fix
     Maximilian Gaß (mxey) - small patches
     Abel Camarillo (00z) - make it compile on OpenBSD
diff --git a/examples/data/uzbl/scripts/uzbl_tabbed.py b/examples/data/uzbl/scripts/uzbl_tabbed.py
new file mode 100755 (executable)
index 0000000..4c3a934
--- /dev/null
@@ -0,0 +1,41 @@
+#!/usr/bin/python
+
+import string, pygtk, gtk, sys, subprocess
+pygtk.require('2.0')
+
+def new_tab(nothing):
+    socket = gtk.Socket()
+    socket.show()
+    notebook.append_page(socket, gtk.Label('title goes here'))
+    sid = socket.get_id()
+    subprocess.call(['sh', '-c', 'uzbl -s %s &'%sid])
+
+
+window = gtk.Window()
+window.show()
+
+vbox = gtk.VBox()
+vbox.show()
+window.add(vbox)
+
+button = gtk.Button(stock=gtk.STOCK_ADD)
+button.connect('clicked', new_tab)
+button.show()
+vbox.add(button)
+
+notebook = gtk.Notebook()
+vbox.add(notebook)
+notebook.show()
+
+window.connect("destroy", lambda w: gtk.main_quit())
+
+#def plugged_event(widget):
+#    print "I (", widget, ") have just had a plug inserted!"
+
+#socket.connect("plug-added", plugged_event)
+#socket.connect("plug-removed", plugged_event)
+
+if len(sys.argv) == 2:
+    socket.add_id(long(sys.argv[1]))
+
+gtk.main()
\ No newline at end of file