surf-startgo-20200913-d068a38.diff (1936B)
1 From 950f05fca48ab3adf0ec955b06c8e7dad3ee2c32 Mon Sep 17 00:00:00 2001 2 From: Luca Wellmeier <luca_wellmeier@gmx.de> 3 Date: Sun, 13 Sep 2020 11:33:25 +0200 4 Subject: [PATCH] add option to start the go prompt immediately after startup 5 6 --- 7 config.def.h | 3 +++ 8 surf.1 | 5 ++++- 9 surf.c | 9 +++++++++ 10 3 files changed, 16 insertions(+), 1 deletion(-) 11 12 diff --git a/config.def.h b/config.def.h 13 index 34265f6..3da943d 100644 14 --- a/config.def.h 15 +++ b/config.def.h 16 @@ -7,6 +7,9 @@ static char *certdir = "~/.surf/certificates/"; 17 static char *cachedir = "~/.surf/cache/"; 18 static char *cookiefile = "~/.surf/cookies.txt"; 19 20 +/* enable to open GO prompt on startup */ 21 +static int startgo = 0; 22 + 23 /* Webkit default features */ 24 /* Highest priority value will be used. 25 * Default parameters are priority 0 26 diff --git a/surf.1 b/surf.1 27 index 45c31bb..54f2dbd 100644 28 --- a/surf.1 29 +++ b/surf.1 30 @@ -3,7 +3,7 @@ 31 surf \- simple webkit-based browser 32 .SH SYNOPSIS 33 .B surf 34 -.RB [-bBdDfFgGiIkKmMnNpPsStTvwxX] 35 +.RB [-bBdDfFgGhiIkKmMnNpPsStTvwxX] 36 .RB [-a\ cookiepolicies] 37 .RB [-c\ cookiefile] 38 .RB [-C\ stylefile] 39 @@ -67,6 +67,9 @@ Disable giving the geolocation to websites. 40 .B \-G 41 Enable giving the geolocation to websites. 42 .TP 43 +.B \-h 44 +Start the GO prompt immediately. 45 +.TP 46 .B \-i 47 Disable Images. 48 .TP 49 diff --git a/surf.c b/surf.c 50 index 2b54e3c..f5fae45 100644 51 --- a/surf.c 52 +++ b/surf.c 53 @@ -2026,6 +2026,9 @@ main(int argc, char *argv[]) 54 defconfig[Geolocation].val.i = 1; 55 defconfig[Geolocation].prio = 2; 56 break; 57 + case 'h': 58 + startgo = 1; 59 + break; 60 case 'i': 61 defconfig[LoadImages].val.i = 0; 62 defconfig[LoadImages].prio = 2; 63 @@ -2120,6 +2123,12 @@ main(int argc, char *argv[]) 64 loaduri(c, &arg); 65 updatetitle(c); 66 67 + if (startgo) { 68 + /* start directly into GO prompt */ 69 + Arg a = (Arg)SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO); 70 + spawn(c, &a); 71 + } 72 + 73 gtk_main(); 74 cleanup(); 75 76 -- 77 2.28.0 78