1 /* modifier 0 means no modifier */
2 static char *useragent
= "Mozilla/5.0 (X11; U; Linux; en-us) AppleWebKit/531.2+ (KHTML, like Gecko, surf-"VERSION
") Safari/531.2+";
3 static char *progress
= "#FF0000";
4 static char *progress_trust
= "#00FF00";
5 static char *stylefile
= ".surf/style.css";
6 static char *scriptfile
= ".surf/script.js";
7 static char *cookiefile
= ".surf/cookies.txt";
8 static char *dldir
= ".surf/dl";
9 static time_t sessiontime
= 3600;
11 #define SETPROP(p) { .v = (char *[]){ "/bin/sh", "-c", \
12 "prop=\"`dmenu < /dev/null`\" &&" \
13 "xprop -id $1 -f $0 8s -set $0 \"$prop\"", \
15 #define MODKEY GDK_CONTROL_MASK
17 /* modifier keyval function arg Focus */
18 { MODKEY
|GDK_SHIFT_MASK
,GDK_r
, reload
, { .b
= TRUE
} },
19 { MODKEY
, GDK_r
, reload
, { .b
= FALSE
} },
20 { MODKEY
|GDK_SHIFT_MASK
,GDK_p
, print
, { 0 } },
21 { MODKEY
, GDK_p
, clipboard
, { .b
= TRUE
} },
22 { MODKEY
, GDK_y
, clipboard
, { .b
= FALSE
} },
23 { MODKEY
|GDK_SHIFT_MASK
,GDK_j
, zoom
, { .i
= -1 } },
24 { MODKEY
|GDK_SHIFT_MASK
,GDK_k
, zoom
, { .i
= +1 } },
25 { MODKEY
|GDK_SHIFT_MASK
,GDK_i
, zoom
, { .i
= 0 } },
26 { MODKEY
, GDK_l
, navigate
, { .i
= +1 } },
27 { MODKEY
, GDK_h
, navigate
, { .i
= -1 } },
28 { MODKEY
, GDK_j
, scroll
, { .i
= +1 } },
29 { MODKEY
, GDK_k
, scroll
, { .i
= -1 } },
30 { 0, GDK_Escape
, stop
, { 0 } },
31 { MODKEY
, GDK_o
, source
, { 0 } },
32 { MODKEY
, GDK_g
, spawn
, SETPROP("_SURF_URI") },
33 { MODKEY
, GDK_slash
, spawn
, SETPROP("_SURF_FIND") },
34 { MODKEY
, GDK_n
, find
, { .b
= TRUE
} },
35 { MODKEY
|GDK_SHIFT_MASK
,GDK_n
, find
, { .b
= FALSE
} },
38 static Item items
[] = {
39 { "Back", navigate
, { .i
= -1 } },
40 { "Forward", navigate
, { .i
= +1 } },
41 { "New Window", newwindow
, { .v
= NULL
} },
42 { "Reload", reload
, { .b
= FALSE
} },
43 { "Stop", stop
, { 0 } },
44 { "Paste URI", clipboard
, { .b
= TRUE
} },
45 { "Copy URI", clipboard
, { .b
= FALSE
} },
46 { "Download", download
, { 0 } },