summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hofmann <scm@uninformativ.de>2014-06-14 12:23:57 +0200
committerPeter Hofmann <scm@uninformativ.de>2014-06-14 12:26:23 +0200
commitb3af9d52dcc487da95410a0db4f90851b526621a (patch)
treebee9daad9654e2779d2465b62cf748783db2f0fb
parent5ddb797131cb772b8509e6bf65c277d9050b06f0 (diff)
downloadlariza-b3af9d52dcc487da95410a0db4f90851b526621a.tar.gz
Support XEMBED
-rw-r--r--README14
-rw-r--r--sn.c17
2 files changed, 28 insertions, 3 deletions
diff --git a/README b/README
index 243f57e..d8a4cb9 100644
--- a/README
+++ b/README
@@ -9,13 +9,25 @@ Features:
- A WebKit viewport
- Global content zoom
+ - Pluggability into suckless' tabbed
Planned features:
- An input box to change the current URL
- vi-like shortcuts
- Adblock
- - Pluggability into suckless' tabbed (preferred) or native tabs
+
+
+Using sn with tabbed
+====================
+
+The order of arguments for sn doesn't matter. This means you can run it
+like this:
+
+ $ tabbed -c ./sn file:///home/hans/bookmarks.html -z 0.8 -e
+
+Each new tab will then show your bookmarks and is scaled by a factor of
+0.8.
Literature
diff --git a/sn.c b/sn.c
index fa93beb..c6d6e2b 100644
--- a/sn.c
+++ b/sn.c
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <gtk/gtk.h>
+#include <gtk/gtkx.h>
#include <webkit/webkit.h>
@@ -21,6 +22,7 @@ static gboolean sn_new_client_request(WebKitWebView *, WebKitWebFrame *,
static void sn_title_changed(GObject *, GParamSpec *, gpointer);
+static Window embed = 0;
static int clients = 0;
static double global_zoom = 1.0;
@@ -102,7 +104,15 @@ sn_new_client(const gchar *uri)
exit(EXIT_FAILURE);
}
- c->win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ if (embed == 0)
+ {
+ c->win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ }
+ else
+ {
+ c->win = gtk_plug_new(embed);
+ }
+
g_signal_connect(G_OBJECT(c->win), "destroy", G_CALLBACK(sn_destroy_client),
c);
gtk_window_set_has_resize_grip(GTK_WINDOW(c->win), FALSE);
@@ -171,13 +181,16 @@ main(int argc, char **argv)
gtk_init(&argc, &argv);
- while ((opt = getopt(argc, argv, "z:")) != -1)
+ while ((opt = getopt(argc, argv, "z:e:")) != -1)
{
switch (opt)
{
case 'z':
global_zoom = atof(optarg);
break;
+ case 'e':
+ embed = atol(optarg);
+ break;
}
}