static void setting_free(Setting *s);
static int cookie_accept(Client *c, const char *name, DataType type, void *value, void *data);
+static int dark_mode(Client *c, const char *name, DataType type, void *value, void *data);
static int default_zoom(Client *c, const char *name, DataType type, void *value, void *data);
static int fullscreen(Client *c, const char *name, DataType type, void *value, void *data);
static int geolocation(Client *c, const char *name, DataType type, void *value, void *data);
setting_add(c, "allow-universal-access-from-file-urls", TYPE_BOOLEAN, &off, webkit, 0, "allow-universal-access-from-file-urls");
setting_add(c, "caret", TYPE_BOOLEAN, &off, webkit, 0, "enable-caret-browsing");
setting_add(c, "cursiv-font", TYPE_CHAR, &"serif", webkit, 0, "cursive-font-family");
+ setting_add(c, "dark-mode", TYPE_BOOLEAN, &off, dark_mode, 0, NULL);
setting_add(c, "default-charset", TYPE_CHAR, &"utf-8", webkit, 0, "default-charset");
setting_add(c, "default-font", TYPE_CHAR, &"sans-serif", webkit, 0, "default-font-family");
setting_add(c, "dns-prefetching", TYPE_BOOLEAN, &on, webkit, 0, "enable-dns-prefetching");
return CMD_SUCCESS;
}
+static int dark_mode(Client *c, const char *name, DataType type, void *value, void *data)
+{
+ g_object_set(gtk_widget_get_settings(GTK_WIDGET(c->window)), "gtk-application-prefer-dark-theme", *(gboolean*)value, NULL);
+
+ return CMD_SUCCESS;
+}
+
static int default_zoom(Client *c, const char *name, DataType type, void *value, void *data)
{
/* Store the percent value in the client config. */