summaryrefslogtreecommitdiff
path: root/surf/config.h
blob: a221c86e393ff7ca4ab5a4ceafecb25f0e170ef3 (plain)
    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;
   18 
   19 /* Webkit default features */
   20 static Bool enablespatialbrowsing = TRUE;
   21 static Bool enableplugins = TRUE;
   22 static Bool enablescripts = TRUE;
   23 static Bool enableinspector = TRUE;
   24 static Bool loadimages = TRUE;
   25 static Bool hidebackground  = FALSE;
   26 
   27 #define SETPROP(p, q) { \
   28 	.v = (char *[]){ "/bin/sh", "-c", \
   29 		"prop=\"`xprop -id $2 $0 | cut -d '\"' -f 2 | dmenu`\" &&" \
   30 		"xprop -id $2 -f $1 8s -set $1 \"$prop\"", \
   31 		p, q, winid, NULL \
   32 	} \
   33 }
   34 
   35 /* DOWNLOAD(URI, referer) */
   36 #define DOWNLOAD(d, r) { \
   37 	.v = (char *[]){ "/bin/sh", "-c", \
   38 		"st -e /bin/sh -c \"curl -J -O --user-agent '$1'" \
   39 		" --referer '$2'" \
   40 		" -b ~/.surf/cookies.txt -c ~/.surf/cookies.txt '$0';" \
   41 		" sleep 5;\"", \
   42 		d, useragent, r, NULL \
   43 	} \
   44 }
   45 
   46 #define MODKEY GDK_CONTROL_MASK
   47 
   48 /* hotkeys */
   49 /*
   50  * If you use anything else but MODKEY and GDK_SHIFT_MASK, don't forget to
   51  * edit the CLEANMASK() macro.
   52  */
   53 static Key keys[] = {
   54     /* modifier	            keyval      function    arg             Focus */
   55     { MODKEY|GDK_SHIFT_MASK,GDK_r,      reload,     { .b = TRUE } },
   56     { MODKEY,               GDK_r,      reload,     { .b = FALSE } },
   57     { MODKEY|GDK_SHIFT_MASK,GDK_p,      print,      { 0 } },
   58 
   59     { MODKEY,               GDK_p,      clipboard,  { .b = TRUE } },
   60     { MODKEY,               GDK_y,      clipboard,  { .b = FALSE } },
   61 
   62     { MODKEY|GDK_SHIFT_MASK,GDK_j,      zoom,       { .i = -1 } },
   63     { MODKEY|GDK_SHIFT_MASK,GDK_k,      zoom,       { .i = +1 } },
   64     { MODKEY|GDK_SHIFT_MASK,GDK_q,      zoom,       { .i = 0  } },
   65     { MODKEY,               GDK_minus,  zoom,       { .i = -1 } },
   66     { MODKEY,               GDK_plus,   zoom,       { .i = +1 } },
   67 
   68     { MODKEY,               GDK_l,      navigate,   { .i = +1 } },
   69     { MODKEY,               GDK_h,      navigate,   { .i = -1 } },
   70 
   71     { MODKEY,               GDK_j,           scroll_v,   { .i = +1 } },
   72     { MODKEY,               GDK_k,           scroll_v,   { .i = -1 } },
   73     { MODKEY,               GDK_b,           scroll_v,   { .i = -10000 } },
   74     { MODKEY,               GDK_space,       scroll_v,   { .i = +10000 } },
   75     { MODKEY,               GDK_i,           scroll_h,   { .i = +1 } },
   76     { MODKEY,               GDK_u,           scroll_h,   { .i = -1 } },
   77 
   78     { 0,                    GDK_F11,    fullscreen, { 0 } },
   79     { 0,                    GDK_Escape, stop,       { 0 } },
   80     { MODKEY,               GDK_o,      source,     { 0 } },
   81     { MODKEY|GDK_SHIFT_MASK,GDK_o,      inspector,  { 0 } },
   82 
   83     { MODKEY,               GDK_g,      spawn,      SETPROP("_SURF_URI", "_SURF_GO") },
   84     { MODKEY,               GDK_f,      spawn,      SETPROP("_SURF_FIND", "_SURF_FIND") },
   85     { MODKEY,               GDK_slash,  spawn,      SETPROP("_SURF_FIND", "_SURF_FIND") },
   86 
   87     { MODKEY,               GDK_n,      find,       { .b = TRUE } },
   88     { MODKEY|GDK_SHIFT_MASK,GDK_n,      find,       { .b = FALSE } },
   89 
   90     { MODKEY|GDK_SHIFT_MASK,GDK_c,      toggle,     { .v = "enable-caret-browsing" } },
   91     { MODKEY|GDK_SHIFT_MASK,GDK_i,      toggle,     { .v = "auto-load-images" } },
   92     { MODKEY|GDK_SHIFT_MASK,GDK_s,      toggle,     { .v = "enable-scripts" } },
   93     { MODKEY|GDK_SHIFT_MASK,GDK_v,      toggle,     { .v = "enable-plugins" } },
   94 };

Generated by cgit