diff options
author | Peter Hofmann <scm@uninformativ.de> | 2014-06-14 12:23:57 +0200 |
---|---|---|
committer | Peter Hofmann <scm@uninformativ.de> | 2014-06-14 12:26:23 +0200 |
commit | b3af9d52dcc487da95410a0db4f90851b526621a (patch) | |
tree | bee9daad9654e2779d2465b62cf748783db2f0fb | |
parent | 5ddb797131cb772b8509e6bf65c277d9050b06f0 (diff) | |
download | lariza-b3af9d52dcc487da95410a0db4f90851b526621a.tar.gz |
Support XEMBED
-rw-r--r-- | README | 14 | ||||
-rw-r--r-- | sn.c | 17 |
2 files changed, 28 insertions, 3 deletions
@@ -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 @@ -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; } } |