1 /* modifier 0 means no modifier */
2 static char *useragent = "Mozilla/5.0 (X11; U; Unix; en-US) "
3 "AppleWebKit/537.15 (KHTML, like Gecko) Chrome/24.0.1295.0 "
4 "Safari/537.15 Surf/"VERSION;
5 static char *progress = "#0000FF";
6 static char *progress_untrust = "#FF0000";
7 static char *progress_trust = "#00FF00";
8 static char *progress_proxy = "#FFFF00";
9 static char *progress_proxy_trust = "#66FF00";
10 static char *progress_proxy_untrust = "#FF6600";
11 static char *stylefile = "~/.surf/style.css";
12 static char *scriptfile = "~/.surf/script.js";
13 static char *cookiefile = "~/.surf/cookies.txt";
14 static time_t sessiontime = 3600;
15 static char *cafile = "/etc/ssl/certs/ca-certificates.crt";
16 static char *strictssl = FALSE; /* Refuse untrusted SSL connections */
17 static int indicator_thickness = 2;
20 static Bool spatialbrowsing = TRUE;
21 static Bool hidebackground = FALSE;
23 #define SETPROP(p, q) { \
24 .v = (char *[]){ "/bin/sh", "-c", \
25 "prop=\"`xprop -id $2 $0 | cut -d '\"' -f 2 | dmenu`\" &&" \
26 "xprop -id $2 -f $1 8s -set $1 \"$prop\"", \
31 /* DOWNLOAD(URI, referer) */
32 #define DOWNLOAD(d, r) { \
33 .v = (char *[]){ "/bin/sh", "-c", \
34 "st -e /bin/sh -c \"wget '$0'" \
35 " --load-cookies ~/.surf/cookies.txt" \
36 " --user-agent '$1'" \
37 " --referer '$2' ; sleep 5\"", d, useragent, r, NULL \
41 #define MODKEY GDK_CONTROL_MASK
45 /* modifier keyval function arg Focus */
46 { MODKEY|GDK_SHIFT_MASK,GDK_r, reload, { .b = TRUE } },
47 { MODKEY, GDK_r, reload, { .b = FALSE } },
48 { MODKEY|GDK_SHIFT_MASK,GDK_p, print, { 0 } },
50 { MODKEY, GDK_p, clipboard, { .b = TRUE } },
51 { MODKEY, GDK_y, clipboard, { .b = FALSE } },
53 { MODKEY|GDK_SHIFT_MASK,GDK_j, zoom, { .i = -1 } },
54 { MODKEY|GDK_SHIFT_MASK,GDK_k, zoom, { .i = +1 } },
55 { MODKEY|GDK_SHIFT_MASK,GDK_q, zoom, { .i = 0 } },
56 { MODKEY, GDK_minus, zoom, { .i = -1 } },
57 { MODKEY, GDK_plus, zoom, { .i = +1 } },
59 { MODKEY, GDK_l, navigate, { .i = +1 } },
60 { MODKEY, GDK_h, navigate, { .i = -1 } },
62 { MODKEY, GDK_j, scroll_v, { .i = +1 } },
63 { MODKEY, GDK_k, scroll_v, { .i = -1 } },
64 { MODKEY, GDK_b, scroll_v, { .i = -10000 } },
65 { MODKEY, GDK_space, scroll_v, { .i = +10000 } },
66 { MODKEY, GDK_i, scroll_h, { .i = +1 } },
67 { MODKEY, GDK_u, scroll_h, { .i = -1 } },
69 { 0, GDK_F11, fullscreen, { 0 } },
70 { 0, GDK_Escape, stop, { 0 } },
71 { MODKEY, GDK_o, source, { 0 } },
73 { MODKEY, GDK_g, spawn, SETPROP("_SURF_URI", "_SURF_GO") },
74 { MODKEY, GDK_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") },
75 { MODKEY, GDK_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") },
77 { MODKEY, GDK_n, find, { .b = TRUE } },
78 { MODKEY|GDK_SHIFT_MASK,GDK_n, find, { .b = FALSE } },
80 { MODKEY|GDK_SHIFT_MASK,GDK_c, toggle, { .v = "enable-caret-browsing" } },
81 { MODKEY|GDK_SHIFT_MASK,GDK_i, toggle, { .v = "auto-load-images" } },
82 { MODKEY|GDK_SHIFT_MASK,GDK_s, toggle, { .v = "enable-scripts" } },
83 { MODKEY|GDK_SHIFT_MASK,GDK_v, toggle, { .v = "enable-plugins" } },