X-Git-Url: https://git.danieliu.xyz/?p=surf.git;a=blobdiff_plain;f=config.def.h;h=a8a4a7bfac5460045d7677d0b3626270549361d7;hp=32cda3ca27d0963fdb471d90ab830c366c4d8a93;hb=654d527f87e59c6c9f507402878bed62398c4e61;hpb=ee854bb09564f869c68d9d63ff8133cf9cf5fa10 diff --git a/config.def.h b/config.def.h index 32cda3c..a8a4a7b 100644 --- a/config.def.h +++ b/config.def.h @@ -3,12 +3,14 @@ static int surfuseragent = 1; /* Append Surf version to default WebKit user static char *fulluseragent = ""; /* Or override the whole user agent string */ static char *scriptfile = "~/.surf/script.js"; static char *styledir = "~/.surf/styles/"; +static char *certdir = "~/.surf/certificates/"; static char *cachedir = "~/.surf/cache/"; static char *cookiefile = "~/.surf/cookies.txt"; /* Webkit default features */ static Parameter defconfig[ParameterLast] = { SETB(AcceleratedCanvas, 1), + SETB(Certificate, 0), SETB(CaretBrowsing, 0), SETV(CookiePolicies, "@Aa"), SETB(DiskCache, 1), @@ -48,13 +50,13 @@ static int winsize[] = { 800, 600 }; static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | WEBKIT_FIND_OPTIONS_WRAP_AROUND; -#define SETPROP(p, q) { \ +/* SETPROP(readprop, setprop)*/ +#define SETPROP(r, s) { \ .v = (const char *[]){ "/bin/sh", "-c", \ - "prop=\"`xprop -id $2 $0 " \ - "| sed \"s/^$0(STRING) = \\(\\\\\"\\?\\)\\(.*\\)\\1$/\\2/\" " \ - "| xargs -0 printf %b | dmenu`\" &&" \ - "xprop -id $2 -f $1 8s -set $1 \"$prop\"", \ - p, q, winid, NULL \ + "prop=\"$(printf '%b' \"$(xprop -id $1 $2 " \ + "| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\")\" " \ + "| dmenu)\" && xprop -id $1 -f $3 8s -set $3 \"$prop\"", \ + "surf-setprop", winid, r, s, NULL \ } \ } @@ -90,11 +92,20 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | * The iteration will stop at the first match, beginning at the beginning of * the list. */ -static SiteStyle styles[] = { +static SiteSpecific styles[] = { /* regexp file in $styledir */ { ".*", "default.css" }, }; +/* certificates */ +/* + * Provide custom certificate for urls + */ +static SiteSpecific certs[] = { + /* regexp file in $certdir */ + { "://suckless\\.org/", "suckless.org.crt" }, +}; + #define MODKEY GDK_CONTROL_MASK /* hotkeys */ @@ -141,6 +152,7 @@ static Key keys[] = { { MODKEY|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } }, { MODKEY|GDK_SHIFT_MASK, GDK_KEY_p, print, { 0 } }, + { MODKEY, GDK_KEY_t, showcert, { 0 } }, { MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } }, { 0, GDK_KEY_F11, togglefullscreen, { 0 } }, @@ -153,6 +165,7 @@ static Key keys[] = { { MODKEY|GDK_SHIFT_MASK, GDK_KEY_i, toggle, { .i = LoadImages } }, { MODKEY|GDK_SHIFT_MASK, GDK_KEY_v, toggle, { .i = Plugins } }, { MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } }, { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } }, };