X-Git-Url: https://git.danieliu.xyz/?p=surf.git;a=blobdiff_plain;f=config.def.h;h=d90fc8d493b58bdd12e05a208fc5c42f764bc3a4;hp=9bdbe0ca1f55a9df4c3d1e824ffb2b1130dea6bb;hb=b8b0c050354d7961edeec74e644f09a3e2887074;hpb=3c2c0a65250e1415124603cb8d91bff4a657d46a diff --git a/config.def.h b/config.def.h index 9bdbe0c..d90fc8d 100644 --- a/config.def.h +++ b/config.def.h @@ -50,23 +50,22 @@ 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 -w $1)\" && xprop -id $1 -f $3 8s -set $3 \"$prop\"", \ + "surf-setprop", winid, r, s, NULL \ } \ } /* DOWNLOAD(URI, referer) */ -#define DOWNLOAD(d, r) { \ - .v = (const char *[]){ "/bin/sh", "-c", \ - "st -e /bin/sh -c \"curl -g -L -J -O --user-agent '$1'" \ - " --referer '$2' -b $3 -c $3 '$0';" \ - " sleep 5;\"", \ - d, useragent, r, cookiefile, NULL \ +#define DOWNLOAD(u, r) { \ + .v = (const char *[]){ "st", "-e", "/bin/sh", "-c",\ + "curl -g -L -J -O -A \"$1\" -b \"$2\" -c \"$2\"" \ + " -e \"$3\" \"$4\"; read", \ + "surf-download", useragent, cookiefile, r, u, NULL \ } \ } @@ -152,6 +151,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 } },