openbsd-ports

OpenBSD Ports customizations and WIP
git clone git://git.danielmoch.com/openbsd-ports.git
Log | Files | Refs

patch-config_def_h (5092B)


      1 --- config.def.h	Tue Mar 28 12:17:45 2017
      2 +++ /home/djmoch/src/dotcom-git/slackbuilds/surf/config.h	Sun Feb  9 19:03:06 2020
      3 @@ -1,10 +1,10 @@
      4  /* modifier 0 means no modifier */
      5  static int surfuseragent    = 1;  /* Append Surf version to default WebKit user agent */
      6  static char *fulluseragent  = ""; /* Or override the whole user agent string */
      7 -static char *scriptfile     = "~/.surf/script.js";
      8 -static char *styledir       = "~/.surf/styles/";
      9 -static char *cachedir       = "~/.surf/cache/";
     10 -static char *cookiefile     = "~/.surf/cookies.txt";
     11 +static char *scriptfile     = "~/etc/surf/script.js";
     12 +static char *styledir       = "~/etc/surf/styles/";
     13 +static char *cachedir       = "~/etc/surf/cache/";
     14 +static char *cookiefile     = "~/etc/surf/cookies.txt";
     15  
     16  /* Webkit default features */
     17  static Parameter defconfig[ParameterLast] = {
     18 @@ -13,12 +13,12 @@
     19  	SETV(CookiePolicies,     "@Aa"),
     20  	SETB(DiskCache,          1),
     21  	SETB(DNSPrefetch,        0),
     22 -	SETI(FontSize,           12),
     23 +	SETI(FontSize,           14),
     24  	SETB(FrameFlattening,    0),
     25  	SETB(Geolocation,        0),
     26  	SETB(HideBackground,     0),
     27  	SETB(Inspector,          0),
     28 -	SETB(JavaScript,         1),
     29 +	SETB(JavaScript,         0),
     30  	SETB(KioskMode,          0),
     31  	SETB(LoadImages,         1),
     32  	SETB(MediaManualPlay,    0),
     33 @@ -32,14 +32,15 @@
     34  	SETV(SpellLanguages,     ((char *[]){ "en_US", NULL })),
     35  	SETB(StrictSSL,          0),
     36  	SETB(Style,              1),
     37 -	SETF(ZoomLevel,          1.0),
     38 +	SETF(ZoomLevel,          1.9),
     39  };
     40  
     41  static UriParameters uriparams[] = {
     42 -	{ "(://|\\.)suckless\\.org(/|$)", {
     43 -	  FSETB(JavaScript, 0),
     44 -	  FSETB(Plugins,    0),
     45 -	}, },
     46 +	{ "(://|\\.)djmoch\\.org(/|$)",     { FSETB(JavaScript, 1), }, },
     47 +	{ "(://|\\.)danielmoch\\.com(/|$)", { FSETB(JavaScript, 1), }, },
     48 +	{ "(://|\\.)twitter\\.com(/|$)",    { FSETB(JavaScript, 1), }, },
     49 +	{ "(://|\\.)github\\.com(/|$)",     { FSETB(JavaScript, 1), }, },
     50 +	{ ".*",                             { FSETB(JavaScript, 0), }, },
     51  };
     52  
     53  static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
     54 @@ -49,17 +50,47 @@
     55          .v = (const char *[]){ "/bin/sh", "-c", \
     56               "prop=\"`xprop -id $2 $0 " \
     57               "| sed \"s/^$0(STRING) = \\(\\\\\"\\?\\)\\(.*\\)\\1$/\\2/\" " \
     58 -             "| xargs -0 printf %b | dmenu`\" &&" \
     59 +             "| xargs -0 printf %b | dmenu -fn \"sans:size=8\" -nb \"#3A3A3A\" " \
     60 +	     "-nf \"#FFFFFF\" -sb \"#BCBCBC\" -sf \"#000000\"`\" &&" \
     61               "xprop -id $2 -f $1 8s -set $1 \"$prop\"", \
     62               p, q, winid, NULL \
     63          } \
     64  }
     65  
     66 +#define SEARCH(p, q) { \
     67 +        .v = (const char *[]){ "/bin/sh", "-c", \
     68 +             "prop=\"https://duckduckgo.com/html?q=`dmenu -p \"Search DuckDuckGo\" " \
     69 +             "-fn \"sans:size=8\" -nb \"#3A3A3A\" " \
     70 +	     "-nf \"#FFFFFF\" -sb \"#BCBCBC\" -sf \"#000000\"`\" &&" \
     71 +             "xprop -id $2 -f $1 8s -set $1 \"$prop\"", \
     72 +             p, q, winid, NULL \
     73 +        } \
     74 +}
     75 +
     76 +#define BMARK(p, q) { \
     77 +        .v = (const char *[]){ "/bin/sh", "-c", \
     78 +             "prop=\"`cat ~/etc/surf/bookmarks " \
     79 +             "| dmenu -fn \"sans:size=8\" -nb \"#3A3A3A\" " \
     80 +	     "-nf \"#FFFFFF\" -sb \"#BCBCBC\" -sf \"#000000\"`\" &&" \
     81 +             "xprop -id $2 -f $1 8s -set $1 \"$prop\"", \
     82 +             p, q, winid, NULL \
     83 +        } \
     84 +}
     85 +
     86 +#define BMARKSAVE(p, q) { \
     87 +        .v = (const char *[]){ "/bin/sh", "-c", \
     88 +             "prop=\"`xprop -id $2 $0 " \
     89 +             "| sed \"s/^$0(STRING) = \\(\\\\\"\\?\\)\\(.*\\)\\1$/\\2/\" " \
     90 +             "| xargs printf %b\n`\" && echo \"$prop\" >> ~/etc/surf/bookmarks", \
     91 +             p, q, winid, NULL \
     92 +        } \
     93 +}
     94 +
     95  /* DOWNLOAD(URI, referer) */
     96  #define DOWNLOAD(d, r) { \
     97          .v = (const char *[]){ "/bin/sh", "-c", \
     98 -             "st -e /bin/sh -c \"curl -g -L -J -O --user-agent '$1'" \
     99 -             " --referer '$2' -b $3 -c $3 '$0';" \
    100 +             "my term -e /bin/sh -c \"cd ~/dl; curl -g -L -J -O " \
    101 +	     "--user-agent '$1' --referer '$2' -b $3 -c $3 '$0';" \
    102               " sleep 5;\"", \
    103               d, useragent, r, cookiefile, NULL \
    104          } \
    105 @@ -78,7 +109,7 @@
    106  /* VIDEOPLAY(URI) */
    107  #define VIDEOPLAY(u) {\
    108          .v = (const char *[]){ "/bin/sh", "-c", \
    109 -             "mpv --really-quiet \"$0\"", u, NULL \
    110 +             "mplayer --really-quiet \"$0\"", u, NULL \
    111          } \
    112  }
    113  
    114 @@ -104,6 +135,9 @@
    115  	{ MODKEY,                GDK_KEY_g,      spawn,      SETPROP("_SURF_URI", "_SURF_GO") },
    116  	{ MODKEY,                GDK_KEY_f,      spawn,      SETPROP("_SURF_FIND", "_SURF_FIND") },
    117  	{ MODKEY,                GDK_KEY_slash,  spawn,      SETPROP("_SURF_FIND", "_SURF_FIND") },
    118 +	{ MODKEY,                GDK_KEY_s,      spawn,      SEARCH("_SURF_URI", "_SURF_GO") },
    119 +	{ MODKEY,                GDK_KEY_d,      spawn,      BMARK("_SURF_URI", "_SURF_GO") },
    120 +	{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_d,      spawn,      BMARKSAVE("_SURF_URI", "_SURF_GO") },
    121  
    122  	{ 0,                     GDK_KEY_Escape, stop,       { 0 } },
    123  	{ MODKEY,                GDK_KEY_c,      stop,       { 0 } },