+static void
+twitch(Client *c, const Arg *arg) {
+ GtkAdjustment *a;
+ gdouble v;
+
+ a = gtk_scrolled_window_get_vadjustment(
+ GTK_SCROLLED_WINDOW(c->scroll));
+
+ v = gtk_adjustment_get_value(a);
+
+ v += arg->i;
+
+ v = MAX(v, 0.0);
+ v = MIN(v, gtk_adjustment_get_upper(a) -
+ gtk_adjustment_get_page_size(a));
+ gtk_adjustment_set_value(a, v);
+}
+
+static void
+togglescrollbars(Client *c, const Arg *arg) {
+ GtkPolicyType vspolicy;
+ Arg a;
+
+ gtk_scrolled_window_get_policy(GTK_SCROLLED_WINDOW(c->scroll), NULL, &vspolicy);
+
+ if(vspolicy == GTK_POLICY_AUTOMATIC) {
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(c->scroll),
+ GTK_POLICY_NEVER, GTK_POLICY_NEVER);
+ } else {
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(c->scroll),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ a.i = +1;
+ twitch(c, &a);
+ a.i = -1;
+ twitch(c, &a);
+ }
+}
+
+static void
+togglestyle(Client *c, const Arg *arg) {
+ WebKitWebSettings *settings;
+ char *uri;
+
+ settings = webkit_web_view_get_settings(c->view);
+ g_object_get(G_OBJECT(settings), "user-stylesheet-uri", &uri, NULL);
+ uri = uri[0] ? g_strdup("") : g_strconcat("file://", stylefile, NULL);
+ g_object_set(G_OBJECT(settings), "user-stylesheet-uri", uri, NULL);
+
+ update(c);
+}
+
+static void
+gettogglestat(Client *c){
+ gboolean value;
+ char *uri;
+ WebKitWebSettings *settings = webkit_web_view_get_settings(c->view);
+
+ g_object_get(G_OBJECT(settings), "enable-caret-browsing",
+ &value, NULL);
+ togglestat[0] = value? 'C': 'c';
+
+ g_object_get(G_OBJECT(settings), "auto-load-images", &value, NULL);
+ togglestat[1] = value? 'I': 'i';
+
+ g_object_get(G_OBJECT(settings), "enable-scripts", &value, NULL);
+ togglestat[2] = value? 'S': 's';
+
+ g_object_get(G_OBJECT(settings), "enable-plugins", &value, NULL);
+ togglestat[3] = value? 'V': 'v';
+
+ g_object_get(G_OBJECT(settings), "user-stylesheet-uri", &uri, NULL);
+ togglestat[4] = uri[0] ? 'M': 'm';
+
+ togglestat[5] = '\0';
+}
+
+static void
+getpagestat(Client *c) {
+ const char *uri = geturi(c);
+
+ if(strstr(uri, "https://") == uri) {
+ pagestat[0] = c->sslfailed ? 'U' : 'T';
+ } else {
+ pagestat[0] = '-';
+ }
+
+ pagestat[1] = usingproxy ? 'P' : '-';
+ pagestat[2] = '\0';
+