diff -r 51a6d05c2c84 config.def.h --- a/config.def.h Mon Mar 26 09:33:42 2012 +0200 +++ b/config.def.h Thu May 31 19:18:35 2012 +0200 @@ -42,4 +42,6 @@ { MODKEY, GDK_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") }, { MODKEY, GDK_n, find, { .b = TRUE } }, { MODKEY|GDK_SHIFT_MASK,GDK_n, find, { .b = FALSE } }, + { MODKEY, GDK_t, setstyle, { .v = ".surf/text_style.css" } }, + { MODKEY|GDK_SHIFT_MASK,GDK_t, setstyle, { .v = (const char *)NULL} }, }; diff -r 51a6d05c2c84 surf.c --- a/surf.c Mon Mar 26 09:33:42 2012 +0200 +++ b/surf.c Thu May 31 19:18:35 2012 +0200 @@ -99,6 +99,7 @@ static void scroll(Client *c, const Arg *arg); static void setatom(Client *c, int a, const char *v); static void setcookie(SoupCookie *c); +static void setstyle(Client *c, const Arg *v); static void setup(void); static void sigchld(int unused); static void source(Client *c, const Arg *arg); @@ -702,6 +703,17 @@ } void +setstyle(Client *c, const Arg *arg){ + WebKitWebSettings *settings; + char *uri, *customstylefile; + + customstylefile = arg->v==NULL?stylefile:(char *)arg->v; + settings = webkit_web_view_get_settings(c->view); + uri = g_strconcat("file://", customstylefile, NULL); + g_object_set(G_OBJECT(settings), "user-stylesheet-uri", uri, NULL); +} + +void setup(void) { char *proxy; char *new_proxy;