summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstkhan <personal@slickd.xyz>2022-05-17 18:17:07 +0000
committerstkhan <personal@slickd.xyz>2022-05-17 18:17:07 +0000
commit9261c7a8a339056c3cd58e0b8979a6f25ea764e5 (patch)
treed83fba0566ab0d1c22cac2d84166dcdf4f2d982f
parentecf6c90d32260530c8f1805d98ff17c4d4693856 (diff)
dwm launches ncmpcpp with pictures, and surf was rebuild
-rw-r--r--dwm-6.3/config.h2
-rw-r--r--surf/Makefile6
-rw-r--r--surf/config.def.h47
-rw-r--r--surf/config.h31
-rw-r--r--surf/patch/surf-2.0-homepage.diff24
-rw-r--r--surf/patch/surf-2.1-history.diff68
-rw-r--r--surf/patch/surf-bookmarks-20170722-723ff26.diff42
-rw-r--r--surf/patch/surf-short-title-20210206-7dcce9e.diff115
-rw-r--r--surf/patch/surf-websearch-20190510-d068a38.diff (renamed from surf/patches/surf-websearch-20190510-d068a38.diff)0
-rw-r--r--surf/style/ddg.css3
-rw-r--r--surf/style/default.css15
-rwxr-xr-xsurf/surf-open.sh32
-rw-r--r--surf/surf.c34
13 files changed, 358 insertions, 61 deletions
diff --git a/dwm-6.3/config.h b/dwm-6.3/config.h
index 8eb612a..882890c 100644
--- a/dwm-6.3/config.h
+++ b/dwm-6.3/config.h
@@ -121,7 +121,7 @@ static Key keys[] = {
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
{ MODKEY, XK_r, spawn, SHCMD("mpvopen") },
{ MODKEY, XK_F3, spawn, SHCMD("st ranger") },
- { MODKEY, XK_F5, spawn, SHCMD("st ncmpcpp") },
+ { MODKEY, XK_F5, spawn, SHCMD("st ncmpcpp-ueberzug") },
{ MODKEY|ShiftMask, XK_f, spawn, SHCMD("firejail --noprofile --hosts-file=~/.config/surf/ads.txt tabbed surf -e") },
{ MODKEY, XK_w, spawn, SHCMD("get_weather") },
{ MODKEY, XK_F11, spawn, SHCMD("pamixer --allow-boost -i 5; kill -44 $(pidof dwmblocks)") },
diff --git a/surf/Makefile b/surf/Makefile
index b428848..1edf820 100644
--- a/surf/Makefile
+++ b/surf/Makefile
@@ -20,10 +20,8 @@ options:
@echo "LDFLAGS = $(LDFLAGS)"
surf: $(OBJ)
- mkdir -p ~/.config/surf/
$(CC) $(SURFLDFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
- cp ads.txt script.js ~/.config/surf/
- cp style/* ~/.config/surf/styles/
+
$(OBJ) $(WOBJ): config.h common.h config.mk
config.h:
@@ -41,7 +39,7 @@ $(WOBJ): $(WSRC)
clean:
rm -f surf $(OBJ)
rm -f $(WLIB) $(WOBJ)
- rm -f ~/.config/surf/script.js
+
distclean: clean
rm -f config.h surf-$(VERSION).tar.gz
diff --git a/surf/config.def.h b/surf/config.def.h
index 8c75ff8..9545af2 100644
--- a/surf/config.def.h
+++ b/surf/config.def.h
@@ -7,7 +7,8 @@ static char *styledir = "~/.surf/styles/";
static char *certdir = "~/.surf/certificates/";
static char *cachedir = "~/.surf/cache/";
static char *cookiefile = "~/.surf/cookies.txt";
-static char *searchurl = "duckduckgo.com/?q=%s";
+static char *historyfile = "~/.surf/history.txt";
+
/* Webkit default features */
/* Highest priority value will be used.
@@ -70,8 +71,9 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
#define SETPROP(r, s, p) { \
.v = (const char *[]){ "/bin/sh", "-c", \
"prop=\"$(printf '%b' \"$(xprop -id $1 $2 " \
- "| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\")\" " \
- "| dmenu -p \"$4\" -w $1)\" && xprop -id $1 -f $3 8s -set $3 \"$prop\"", \
+ "| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\" && cat ~/.surf/bookmarks)\" " \
+ "| dmenu -l 10 -p \"$4\" -w $1)\" && " \
+ "xprop -id $1 -f $3 8s -set $3 \"$prop\"", \
"surf-setprop", winid, r, s, p, NULL \
} \
}
@@ -84,6 +86,30 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
} \
}
+#define SEARCH() { \
+ .v = (const char *[]){ "/bin/sh", "-c", \
+ "xprop -id $1 -f $2 8s -set $2 \"" \
+ "$(dmenu -p Search: -w $1 < /dev/null)\"", \
+ "surf-search", winid, "_SURF_SEARCH", NULL \
+ } \
+}
+
+#define SEARCH() { \
+ .v = (const char *[]){ "/bin/sh", "-c", \
+ "xprop -id $1 -f $2 8s -set $2 \"" \
+ "$(dmenu -p Search: -w $1 < /dev/null)\"", \
+ "surf-search", winid, "_SURF_SEARCH", NULL \
+ } \
+}
+
+#define SEARCH() { \
+ .v = (const char *[]){ "/bin/sh", "-c", \
+ "xprop -id $1 -f $2 8s -set $2 \"" \
+ "$(dmenu -p Search: -w $1 < /dev/null)\"", \
+ "surf-search", winid, "_SURF_SEARCH", NULL \
+ } \
+}
+
/* DOWNLOAD(URI, referer) */
#define DOWNLOAD(u, r) { \
.v = (const char *[]){ "st", "-e", "/bin/sh", "-c",\
@@ -110,6 +136,17 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
} \
}
+/* BM_ADD(readprop) */
+#define BM_ADD(r) {\
+ .v = (const char *[]){ "/bin/sh", "-c", \
+ "(echo $(xprop -id $0 $1) | cut -d '\"' -f2 " \
+ "| sed 's/.*https*:\\/\\/\\(www\\.\\)\\?//' && cat ~/.surf/bookmarks) " \
+ "| awk '!seen[$0]++' > ~/.surf/bookmarks.tmp && " \
+ "mv ~/.surf/bookmarks.tmp ~/.surf/bookmarks", \
+ winid, r, NULL \
+ } \
+}
+
/* styles */
/*
* The iteration will stop at the first match, beginning at the beginning of
@@ -141,7 +178,9 @@ static Key keys[] = {
{ MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) },
{ MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
{ MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
- { MODKEY, GDK_KEY_s, spawn, SEARCH() },
+ { MODKEY, GDK_KEY_m, spawn, BM_ADD("_SURF_URI") },
+ { MODKEY, GDK_KEY_s, spawn, SEARCH() },
+
{ 0, GDK_KEY_Escape, stop, { 0 } },
{ MODKEY, GDK_KEY_c, stop, { 0 } },
diff --git a/surf/config.h b/surf/config.h
index 4c824b1..22dca0d 100644
--- a/surf/config.h
+++ b/surf/config.h
@@ -8,7 +8,7 @@ static char *certdir = "~/.config/surf/certificates/";
static char *cachedir = "~/.config/surf/cache/";
static char *cookiefile = "~/.config/surf/cookies.txt";
static char *historyfile = "~/.config/surf/history.txt";
-static char *searchurl = "duckduckgo.com/?q=%s";
+static char *searchurl = "duckduckgo.com/?q=%s";
/* Webkit default features */
/* Highest priority value will be used.
@@ -24,7 +24,6 @@ static Parameter defconfig[ParameterLast] = {
[CaretBrowsing] = { { .i = 0 }, },
[CookiePolicies] = { { .v = "@Aa" }, },
[DefaultCharset] = { { .v = "UTF-8" }, },
- [DarkMode] = { { .i = 0 } },
[DiskCache] = { { .i = 1 }, },
[DNSPrefetch] = { { .i = 0 }, },
[Ephemeral] = { { .i = 0 }, },
@@ -72,8 +71,9 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
#define SETPROP(r, s, p) { \
.v = (const char *[]){ "/bin/sh", "-c", \
"prop=\"$(printf '%b' \"$(xprop -id $1 $2 " \
- "| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\")\" " \
- "| dmenu -p \"$4\" -w $1)\" && xprop -id $1 -f $3 8s -set $3 \"$prop\"", \
+ "| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\" && cat ~/.config/surf/bookmarks)\" " \
+ "| dmenu -l 10 -p \"$4\" -w $1)\" && " \
+ "xprop -id $1 -f $3 8s -set $3 \"$prop\"", \
"surf-setprop", winid, r, s, p, NULL \
} \
}
@@ -86,11 +86,6 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
} \
}
-#define SETURI(p) {.v = (char *[]){ "/bin/sh", "-c", \
- "prop=\"`tac ~/.config/surf/history.txt | sed 's/^[^ *]* //' | sort -u | dmenu -l 10 -i | cut -d ' ' -f 3`\" &&" \
- "xprop -id $1 -f $0 8s -set $0 \"$prop\"", \
- p, winid, NULL } }
-
/* DOWNLOAD(URI, referer) */
#define DOWNLOAD(u, r) { \
.v = (const char *[]){ "st", "-e", "/bin/sh", "-c",\
@@ -117,6 +112,17 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
} \
}
+/* BM_ADD(readprop) */
+#define BM_ADD(r) {\
+ .v = (const char *[]){ "/bin/sh", "-c", \
+ "(echo $(xprop -id $0 $1) | cut -d '\"' -f2 " \
+ "| sed 's/.*https*:\\/\\/\\(www\\.\\)\\?//' && cat ~/.config/surf/bookmarks) " \
+ "| awk '!seen[$0]++' > ~/.config/surf/bookmarks.tmp && " \
+ "mv ~/.config/surf/bookmarks.tmp ~/.config/surf/bookmarks", \
+ winid, r, NULL \
+ } \
+}
+
/* styles */
/*
* The iteration will stop at the first match, beginning at the beginning of
@@ -125,7 +131,6 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
static SiteSpecific styles[] = {
/* regexp file in $styledir */
{ ".*", "default.css" },
- { "www.duckduckgo.com*", "ddg.css" },
};
/* certificates */
@@ -149,8 +154,9 @@ static Key keys[] = {
{ MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) },
{ MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
{ MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
- { MODKEY, GDK_KEY_e, spawn, SETURI("_SURF_GO") },
- { MODKEY, GDK_KEY_s, spawn, SEARCH() },
+ { MODKEY, GDK_KEY_m, spawn, BM_ADD("_SURF_URI") },
+ { MODKEY, GDK_KEY_s, spawn, SEARCH() },
+
{ 0, GDK_KEY_Escape, stop, { 0 } },
{ MODKEY, GDK_KEY_c, stop, { 0 } },
@@ -196,7 +202,6 @@ static Key keys[] = {
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_s, toggle, { .i = JavaScript } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_i, toggle, { .i = LoadImages } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } },
- { MODKEY|GDK_SHIFT_MASK, GDK_KEY_d, toggle, { .i = DarkMode } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } },
};
diff --git a/surf/patch/surf-2.0-homepage.diff b/surf/patch/surf-2.0-homepage.diff
new file mode 100644
index 0000000..f32016f
--- /dev/null
+++ b/surf/patch/surf-2.0-homepage.diff
@@ -0,0 +1,24 @@
+diff --git a/config.def.h b/config.def.h
+--- a/config.def.h
++++ b/config.def.h
+@@ -164,3 +164,5 @@ static Button buttons[] = {
+ { OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 },
+ { OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 },
+ };
++
++#define HOMEPAGE "https://duckduckgo.com/"
+diff --git a/surf.c b/surf.c
+--- a/surf.c
++++ b/surf.c
+@@ -1751,7 +1751,11 @@ main(int argc, char *argv[])
+ if (argc > 0)
+ arg.v = argv[0];
+ else
++#ifdef HOMEPAGE
++ arg.v = HOMEPAGE;
++#else
+ arg.v = "about:blank";
++#endif
+
+ setup();
+ c = newclient(NULL);
diff --git a/surf/patch/surf-2.1-history.diff b/surf/patch/surf-2.1-history.diff
new file mode 100644
index 0000000..453750d
--- /dev/null
+++ b/surf/patch/surf-2.1-history.diff
@@ -0,0 +1,68 @@
+diff --git a/config.def.h b/config.def.h
+index b6ae4fc..74b1968 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -6,6 +6,8 @@ static char *styledir = "~/.surf/styles/";
+ static char *certdir = "~/.surf/certificates/";
+ static char *cachedir = "~/.surf/cache/";
+ static char *cookiefile = "~/.surf/cookies.txt";
++static char *historyfile = "~/.surf/history.txt";
++
+
+ /* Webkit default features */
+ /* Highest priority value will be used.
+diff --git a/surf.c b/surf.c
+index e709f35..d7c2166 100644
+--- a/surf.c
++++ b/surf.c
+@@ -347,9 +347,10 @@ setup(void)
+ curconfig = defconfig;
+
+ /* dirs and files */
+- cookiefile = buildfile(cookiefile);
+- scriptfile = buildfile(scriptfile);
+- certdir = buildpath(certdir);
++ cookiefile = buildfile(cookiefile);
++ historyfile = buildfile(historyfile);
++ scriptfile = buildfile(scriptfile);
++ certdir = buildpath(certdir);
+ if (curconfig[Ephemeral].val.i)
+ cachedir = NULL;
+ else
+@@ -589,6 +590,7 @@ loaduri(Client *c, const Arg *a)
+ } else {
+ webkit_web_view_load_uri(c->view, url);
+ updatetitle(c);
++ updatehistory(url);
+ }
+
+ g_free(url);
+@@ -659,6 +661,20 @@ updatetitle(Client *c)
+ }
+ }
+
++void
++updatehistory(const char *url)
++{
++ FILE *f;
++ f = fopen(historyfile, "a+");
++
++ char timestamp[20];
++ time_t now = time (0);
++ strftime (timestamp, 20, "%Y-%m-%dT%H:%M:%S", localtime (&now));
++
++ fprintf(f, "%s %s\n", timestamp, url);
++ fclose(f);
++}
++
+ void
+ gettogglestats(Client *c)
+ {
+@@ -1085,6 +1101,7 @@ cleanup(void)
+ close(spair[0]);
+ close(spair[1]);
+ g_free(cookiefile);
++ g_free(historyfile);
+ g_free(scriptfile);
+ g_free(stylefile);
+ g_free(cachedir);
diff --git a/surf/patch/surf-bookmarks-20170722-723ff26.diff b/surf/patch/surf-bookmarks-20170722-723ff26.diff
new file mode 100644
index 0000000..323ba55
--- /dev/null
+++ b/surf/patch/surf-bookmarks-20170722-723ff26.diff
@@ -0,0 +1,42 @@
+diff --git a/config.def.h b/config.def.h
+index 2e735bf..43ad9ab 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -69,8 +69,9 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
+ #define SETPROP(r, s, p) { \
+ .v = (const char *[]){ "/bin/sh", "-c", \
+ "prop=\"$(printf '%b' \"$(xprop -id $1 $2 " \
+- "| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\")\" " \
+- "| dmenu -p \"$4\" -w $1)\" && xprop -id $1 -f $3 8s -set $3 \"$prop\"", \
++ "| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\" && cat ~/.surf/bookmarks)\" " \
++ "| dmenu -l 10 -p \"$4\" -w $1)\" && " \
++ "xprop -id $1 -f $3 8s -set $3 \"$prop\"", \
+ "surf-setprop", winid, r, s, p, NULL \
+ } \
+ }
+@@ -101,6 +102,17 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
+ } \
+ }
+
++/* BM_ADD(readprop) */
++#define BM_ADD(r) {\
++ .v = (const char *[]){ "/bin/sh", "-c", \
++ "(echo $(xprop -id $0 $1) | cut -d '\"' -f2 " \
++ "| sed 's/.*https*:\\/\\/\\(www\\.\\)\\?//' && cat ~/.surf/bookmarks) " \
++ "| awk '!seen[$0]++' > ~/.surf/bookmarks.tmp && " \
++ "mv ~/.surf/bookmarks.tmp ~/.surf/bookmarks", \
++ winid, r, NULL \
++ } \
++}
++
+ /* styles */
+ /*
+ * The iteration will stop at the first match, beginning at the beginning of
+@@ -132,6 +144,7 @@ static Key keys[] = {
+ { MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) },
+ { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
+ { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
++ { MODKEY, GDK_KEY_m, spawn, BM_ADD("_SURF_URI") },
+
+ { 0, GDK_KEY_Escape, stop, { 0 } },
+ { MODKEY, GDK_KEY_c, stop, { 0 } },
diff --git a/surf/patch/surf-short-title-20210206-7dcce9e.diff b/surf/patch/surf-short-title-20210206-7dcce9e.diff
new file mode 100644
index 0000000..4a0a8a4
--- /dev/null
+++ b/surf/patch/surf-short-title-20210206-7dcce9e.diff
@@ -0,0 +1,115 @@
+From d5437333d64ff5eb7aaab19e4d42b11d6773a7b0 Mon Sep 17 00:00:00 2001
+From: Harsh Parekh <harsh_parekh@outlook.com>
+Date: Sat, 6 Feb 2021 08:33:49 -0500
+Subject: [PATCH] Hide status from title.
+
+You can pass -E 1 to show the extended title.
+---
+ config.def.h | 2 ++
+ surf.1 | 7 +++++++
+ surf.c | 31 ++++++++++++++++++++++++-------
+ 3 files changed, 33 insertions(+), 7 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index be168ab..2783e4d 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -1,5 +1,6 @@
+ /* modifier 0 means no modifier */
+ static int surfuseragent = 1; /* Append Surf version to default WebKit user agent */
++static int extendedtitle = 0; /* 0 to not append surf's toggle and page status to title. */
+ static char *fulluseragent = ""; /* Or override the whole user agent string */
+ static char *scriptfile = "~/.surf/script.js";
+ static char *styledir = "~/.surf/styles/";
+@@ -176,6 +177,7 @@ static Key keys[] = {
+ { MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } },
+ { 0, GDK_KEY_F11, togglefullscreen, { 0 } },
+ { MODKEY|GDK_SHIFT_MASK, GDK_KEY_o, toggleinspector, { 0 } },
++ { MODKEY|GDK_SHIFT_MASK, GDK_KEY_e, toggletitle, { 0 } },
+
+ { MODKEY|GDK_SHIFT_MASK, GDK_KEY_c, toggle, { .i = CaretBrowsing } },
+ { MODKEY|GDK_SHIFT_MASK, GDK_KEY_f, toggle, { .i = FrameFlattening } },
+diff --git a/surf.1 b/surf.1
+index 45c31bb..0e15c61 100644
+--- a/surf.1
++++ b/surf.1
+@@ -55,6 +55,13 @@ Enable the disk cache.
+ Reparents to window specified by
+ .IR xid .
+ .TP
++.B \-E [1|0]
++Show or hide
++.I indicators of operation
++and
++.I indicators of web page
++in the title.
++.TP
+ .B \-f
+ Start surf in windowed mode (not fullscreen).
+ .TP
+diff --git a/surf.c b/surf.c
+index ac832ff..bca0b91 100644
+--- a/surf.c
++++ b/surf.c
+@@ -234,6 +234,7 @@ static void toggle(Client *c, const Arg *a);
+ static void togglefullscreen(Client *c, const Arg *a);
+ static void togglecookiepolicy(Client *c, const Arg *a);
+ static void toggleinspector(Client *c, const Arg *a);
++static void toggletitle(Client *c, const Arg *a);
+ static void find(Client *c, const Arg *a);
+
+ /* Buttons */
+@@ -649,13 +650,19 @@ updatetitle(Client *c)
+ gettogglestats(c);
+ getpagestats(c);
+
+- if (c->progress != 100)
+- title = g_strdup_printf("[%i%%] %s:%s | %s",
+- c->progress, togglestats, pagestats, name);
+- else
+- title = g_strdup_printf("%s:%s | %s",
+- togglestats, pagestats, name);
+-
++ if (c->progress != 100) {
++ if (!extendedtitle)
++ title = g_strdup_printf("[%i%%] %s", c->progress, name);
++ else
++ title = g_strdup_printf("[%i%%] %s:%s | %s",
++ c->progress, togglestats, pagestats, name);
++ } else {
++ if (!extendedtitle)
++ title = g_strdup_printf("%s", name);
++ else
++ title = g_strdup_printf("%s:%s | %s",
++ togglestats, pagestats, name);
++ }
+ gtk_window_set_title(GTK_WINDOW(c->win), title);
+ g_free(title);
+ } else {
+@@ -1953,6 +1960,13 @@ toggleinspector(Client *c, const Arg *a)
+ webkit_web_inspector_show(c->inspector);
+ }
+
++void
++toggletitle(Client *c, const Arg *a)
++{
++ extendedtitle = !extendedtitle;
++ updatetitle(c);
++}
++
+ void
+ find(Client *c, const Arg *a)
+ {
+@@ -2042,6 +2056,9 @@ main(int argc, char *argv[])
+ case 'e':
+ embed = strtol(EARGF(usage()), NULL, 0);
+ break;
++ case 'E':
++ extendedtitle = strtol(EARGF(usage()), NULL, 0);
++ break;
+ case 'f':
+ defconfig[RunInFullscreen].val.i = 0;
+ defconfig[RunInFullscreen].prio = 2;
+--
+2.30.0
+
diff --git a/surf/patches/surf-websearch-20190510-d068a38.diff b/surf/patch/surf-websearch-20190510-d068a38.diff
index 7e7f92a..7e7f92a 100644
--- a/surf/patches/surf-websearch-20190510-d068a38.diff
+++ b/surf/patch/surf-websearch-20190510-d068a38.diff
diff --git a/surf/style/ddg.css b/surf/style/ddg.css
deleted file mode 100644
index f15cdd7..0000000
--- a/surf/style/ddg.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.body --home {
- background: #141414;
-}
diff --git a/surf/style/default.css b/surf/style/default.css
deleted file mode 100644
index 5cd091b..0000000
--- a/surf/style/default.css
+++ /dev/null
@@ -1,15 +0,0 @@
-*,div,pre,textarea,body,input,td,tr,p {
- background-color: #202020 !important;
- background-image: none !important;
- color: #bbbbbb !important;
-}
-h1,h2,h3,h4 {
- background-color: #202020 !important;
- color: #b8ddea !important;
-}
-img {
- opacity: .5;
-}
-img:hover {
- opacity: 1;
-}
diff --git a/surf/surf-open.sh b/surf/surf-open.sh
new file mode 100755
index 0000000..c22edc2
--- /dev/null
+++ b/surf/surf-open.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# See the LICENSE file for copyright and license details.
+#
+
+xidfile="$HOME/tmp/tabbed-surf.xid"
+uri=""
+
+if [ "$#" -gt 0 ];
+then
+ uri="$1"
+fi
+
+runtabbed() {
+ tabbed -dn tabbed-surf -r 2 surf -e '' "$uri" >"$xidfile" \
+ 2>/dev/null &
+}
+
+if [ ! -r "$xidfile" ];
+then
+ runtabbed
+else
+ xid=$(cat "$xidfile")
+ xprop -id "$xid" >/dev/null 2>&1
+ if [ $? -gt 0 ];
+ then
+ runtabbed
+ else
+ surf -e "$xid" "$uri" >/dev/null 2>&1 &
+ fi
+fi
+
diff --git a/surf/surf.c b/surf/surf.c
index 552ea44..252a79a 100644
--- a/surf/surf.c
+++ b/surf/surf.c
@@ -56,7 +56,6 @@ typedef enum {
CaretBrowsing,
Certificate,
CookiePolicies,
- DarkMode,
DiskCache,
DefaultCharset,
DNSPrefetch,
@@ -262,7 +261,6 @@ char *argv0;
static ParamName loadtransient[] = {
Certificate,
CookiePolicies,
- DarkMode,
DiskCache,
DNSPrefetch,
FileURLsCrossAccess,
@@ -440,7 +438,18 @@ sighup(int unused)
for (c = clients; c; c = c->next)
reload(c, &a);
}
-
+void
+search(Client *c, const Arg *a)
+{
+ Arg arg;
+ char *url;
+
+ url = g_strdup_printf(searchurl, a->v);
+ arg.v = url;
+ loaduri(c, &arg);
+
+ g_free(url);
+ }
char *
buildfile(const char *path)
{
@@ -601,19 +610,6 @@ loaduri(Client *c, const Arg *a)
g_free(url);
}
-void
-search(Client *c, const Arg *a)
-{
- Arg arg;
- char *url;
-
- url = g_strdup_printf(searchurl, a->v);
- arg.v = url;
- loaduri(c, &arg);
-
- g_free(url);
-}
-
const char *
geturi(Client *c)
{
@@ -811,10 +807,6 @@ setparameter(Client *c, int refresh, ParamName p, const Arg *a)
cookiepolicy_get());
refresh = 0;
break;
- case DarkMode:
- g_object_set(gtk_settings_get_default(),
- "gtk-application-prefer-dark-theme", a->i, NULL);
- break;
case DiskCache:
webkit_web_context_set_cache_model(
webkit_web_view_get_context(c->view), a->i ?
@@ -1365,7 +1357,7 @@ processx(GdkXEvent *e, GdkEvent *event, gpointer d)
find(c, NULL);
return GDK_FILTER_REMOVE;
- } else if (ev->atom == atoms[AtomSearch]) {
+ } else if (ev->atom == atoms[AtomSearch]) {
a.v = getatom(c, AtomSearch);
search(c, &a);
} else if (ev->atom == atoms[AtomGo]) {