summaryrefslogtreecommitdiff
path: root/surf/patches
diff options
context:
space:
mode:
Diffstat (limited to 'surf/patches')
-rw-r--r--surf/patches/surf-2.0-homepage.diff24
-rw-r--r--surf/patches/surf-2.1-history.diff68
-rw-r--r--surf/patches/surf-bookmarks-20170722-723ff26.diff42
-rw-r--r--surf/patches/surf-clipboard-20200112-a6a8878.diff67
-rw-r--r--surf/patches/surf-gtkblackbg-20231229-30f5464.diff39
-rw-r--r--surf/patches/surf-middleclickplumb-20200815-d068a38.diff60
-rw-r--r--surf/patches/surf-modal-20190209-d068a38.diff134
-rw-r--r--surf/patches/surf-notifications-20230403-665a709.diff106
-rw-r--r--surf/patches/surf-playexternal-20190724-b814567.diff54
-rw-r--r--surf/patches/surf-quit_hotkey-20210830-11dca18.diff53
-rw-r--r--surf/patches/surf-scrollmultiply-2.0.diff35
-rw-r--r--surf/patches/surf-searchengines-20220804-609ea1c.diff94
-rw-r--r--surf/patches/surf-spacesearch-20170408-b814567.diff26
-rw-r--r--surf/patches/surf-startgo-20200913-d068a38.diff78
-rw-r--r--surf/patches/surf-uri-aliases-20220930-089272b.diff58
-rw-r--r--surf/patches/surf-xdg-2.0.diff159
-rw-r--r--surf/patches/surf-zoommtghandler-2.1.diff69
17 files changed, 1166 insertions, 0 deletions
diff --git a/surf/patches/surf-2.0-homepage.diff b/surf/patches/surf-2.0-homepage.diff
new file mode 100644
index 0000000..f32016f
--- /dev/null
+++ b/surf/patches/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/patches/surf-2.1-history.diff b/surf/patches/surf-2.1-history.diff
new file mode 100644
index 0000000..453750d
--- /dev/null
+++ b/surf/patches/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/patches/surf-bookmarks-20170722-723ff26.diff b/surf/patches/surf-bookmarks-20170722-723ff26.diff
new file mode 100644
index 0000000..323ba55
--- /dev/null
+++ b/surf/patches/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/patches/surf-clipboard-20200112-a6a8878.diff b/surf/patches/surf-clipboard-20200112-a6a8878.diff
new file mode 100644
index 0000000..5c43025
--- /dev/null
+++ b/surf/patches/surf-clipboard-20200112-a6a8878.diff
@@ -0,0 +1,67 @@
+From a6a8878bb6a203b589d559025b94a78214f22878 Mon Sep 17 00:00:00 2001
+From: Olivier Moreau <m242@protonmail.com>
+Date: Sun, 12 Jan 2020 11:23:11 +0000
+Subject: [PATCH] Added choice between PRIMARY and CLIPBOARD Gtk selections, as
+ a config option
+
+---
+ config.def.h | 1 +
+ surf.c | 11 +++++++++--
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 34265f6..03bbe2b 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -48,6 +48,7 @@ static Parameter defconfig[ParameterLast] = {
+ [Style] = { { .i = 1 }, },
+ [WebGL] = { { .i = 0 }, },
+ [ZoomLevel] = { { .f = 1.0 }, },
++ [ClipboardNotPrimary] = { { .i = 1 }, },
+ };
+
+ static UriParameters uriparams[] = {
+diff --git a/surf.c b/surf.c
+index 2b54e3c..b8a9b2f 100644
+--- a/surf.c
++++ b/surf.c
+@@ -82,6 +82,7 @@ typedef enum {
+ Style,
+ WebGL,
+ ZoomLevel,
++ ClipboardNotPrimary,
+ ParameterLast
+ } ParamName;
+
+@@ -291,6 +292,7 @@ static ParamName loadcommitted[] = {
+ SpellLanguages,
+ Style,
+ ZoomLevel,
++ ClipboardNotPrimary,
+ ParameterLast
+ };
+
+@@ -1816,13 +1818,18 @@ showcert(Client *c, const Arg *a)
+ void
+ clipboard(Client *c, const Arg *a)
+ {
++ /* User defined choice of selection, see config.h */
++ GdkAtom selection = GDK_SELECTION_PRIMARY;
++ if (curconfig[ClipboardNotPrimary].val.i > 0)
++ selection = GDK_SELECTION_CLIPBOARD;
++
+ if (a->i) { /* load clipboard uri */
+ gtk_clipboard_request_text(gtk_clipboard_get(
+- GDK_SELECTION_PRIMARY),
++ selection),
+ pasteuri, c);
+ } else { /* copy uri */
+ gtk_clipboard_set_text(gtk_clipboard_get(
+- GDK_SELECTION_PRIMARY), c->targeturi
++ selection), c->targeturi
+ ? c->targeturi : geturi(c), -1);
+ }
+ }
+--
+2.24.1
+
diff --git a/surf/patches/surf-gtkblackbg-20231229-30f5464.diff b/surf/patches/surf-gtkblackbg-20231229-30f5464.diff
new file mode 100644
index 0000000..990f842
--- /dev/null
+++ b/surf/patches/surf-gtkblackbg-20231229-30f5464.diff
@@ -0,0 +1,39 @@
+From 45401ba76aa0157d49cba61dbc42ddc03d675796 Mon Sep 17 00:00:00 2001
+From: Scarlett McAllister <no+reply@roygbyte.com>
+Date: Fri, 29 Dec 2023 12:41:32 -0400
+Subject: [PATCH] Add black bg to gtk window and make it visible through webkit
+ view
+
+---
+ config.def.h | 2 +-
+ surf.c | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/config.def.h b/config.def.h
+index 93cfeeb..ba68287 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -29,7 +29,7 @@ static Parameter defconfig[ParameterLast] = {
+ [FontSize] = { { .i = 12 }, },
+ [FrameFlattening] = { { .i = 0 }, },
+ [Geolocation] = { { .i = 0 }, },
+- [HideBackground] = { { .i = 0 }, },
++ [HideBackground] = { { .i = 1 }, },
+ [Inspector] = { { .i = 0 }, },
+ [Java] = { { .i = 1 }, },
+ [JavaScript] = { { .i = 1 }, },
+diff --git a/surf.c b/surf.c
+index f8c8dec..a6cb224 100644
+--- a/surf.c
++++ b/surf.c
+@@ -1461,6 +1461,7 @@ createwindow(Client *c)
+ g_signal_connect(G_OBJECT(w), "window-state-event",
+ G_CALLBACK(winevent), c);
+
++ gtk_widget_modify_bg(GTK_WINDOW(w), GTK_STATE_NORMAL, &(GdkColor){0});
+ return w;
+ }
+
+--
+2.42.0
+
diff --git a/surf/patches/surf-middleclickplumb-20200815-d068a38.diff b/surf/patches/surf-middleclickplumb-20200815-d068a38.diff
new file mode 100644
index 0000000..0c447a7
--- /dev/null
+++ b/surf/patches/surf-middleclickplumb-20200815-d068a38.diff
@@ -0,0 +1,60 @@
+From f675414e350d9c4face743a1bfc4af8a2cd445cd Mon Sep 17 00:00:00 2001
+From: 0x1bi <ben@0x1bi.net>
+Date: Sat, 15 Aug 2020 12:05:11 -0400
+Subject: [PATCH] fix for middle click to plumb
+
+---
+ config.def.h | 2 +-
+ surf.c | 16 ++++++++++++++++
+ 2 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/config.def.h b/config.def.h
+index 34265f6..01d040a 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -186,7 +186,7 @@ static Key keys[] = {
+ /* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */
+ static Button buttons[] = {
+ /* target event mask button function argument stop event */
+- { OnLink, 0, 2, clicknewwindow, { .i = 0 }, 1 },
++ { OnAny, 0, 2, clickplumb, { .i = 0 }, 1 },
+ { OnLink, MODKEY, 2, clicknewwindow, { .i = 1 }, 1 },
+ { OnLink, MODKEY, 1, clicknewwindow, { .i = 1 }, 1 },
+ { OnAny, 0, 8, clicknavigate, { .i = -1 }, 1 },
+diff --git a/surf.c b/surf.c
+index 2b54e3c..46e6934 100644
+--- a/surf.c
++++ b/surf.c
+@@ -236,6 +236,7 @@ static void find(Client *c, const Arg *a);
+ static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h);
+ static void clicknewwindow(Client *c, const Arg *a, WebKitHitTestResult *h);
+ static void clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h);
++static void clickplumb(Client *c, const Arg *a, WebKitHitTestResult *h);
+
+ static char winid[64];
+ static char togglestats[12];
+@@ -1971,6 +1972,21 @@ clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h)
+ spawn(c, &arg);
+ }
+
++void
++clickplumb(Client *c, const Arg *a, WebKitHitTestResult *h)
++{
++ Arg arg;
++
++ char *s;
++ WebKitHitTestResultContext e = webkit_hit_test_result_get_context(h);
++ if (OnSel & e)
++ s = gtk_clipboard_wait_for_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY));
++ else if ((OnLink|OnMedia|OnImg) & e)
++ s = webkit_hit_test_result_get_link_uri(h);
++ arg = (Arg)PLUMB(s);
++ spawn(c, &arg);
++}
++
+ int
+ main(int argc, char *argv[])
+ {
+--
+2.26.2
+
diff --git a/surf/patches/surf-modal-20190209-d068a38.diff b/surf/patches/surf-modal-20190209-d068a38.diff
new file mode 100644
index 0000000..f6508f0
--- /dev/null
+++ b/surf/patches/surf-modal-20190209-d068a38.diff
@@ -0,0 +1,134 @@
+From 74a98d9600c50d50b9323cf8e459c88eb15da557 Mon Sep 17 00:00:00 2001
+From: efe <efe@efe.kim>
+Date: Sat, 9 Feb 2019 13:16:51 -0500
+Subject: [PATCH] Modal behaviour, 'i' to insert 'Esc' to get to the normal
+ mode
+
+---
+ config.def.h | 53 +++++++++++++++++++++++++++-------------------------
+ surf.c | 14 +++++++++++++-
+ 2 files changed, 41 insertions(+), 26 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 34265f6..8b7d5a2 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -130,41 +130,44 @@ static SiteSpecific certs[] = {
+ */
+ static Key keys[] = {
+ /* modifier keyval function arg */
+- { 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) },
++ { 0, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) },
++ { 0, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
++ { 0, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
+
+- { 0, GDK_KEY_Escape, stop, { 0 } },
+- { MODKEY, GDK_KEY_c, stop, { 0 } },
++ { 0, GDK_KEY_i, insert, { .i = 1 } },
++ { 0, GDK_KEY_Escape, insert, { .i = 0 } },
+
+- { MODKEY|GDK_SHIFT_MASK, GDK_KEY_r, reload, { .i = 1 } },
+- { MODKEY, GDK_KEY_r, reload, { .i = 0 } },
++ { 0, GDK_KEY_c, stop, { 0 } },
+
+- { MODKEY, GDK_KEY_l, navigate, { .i = +1 } },
+- { MODKEY, GDK_KEY_h, navigate, { .i = -1 } },
++ { MODKEY, GDK_KEY_r, reload, { .i = 1 } },
++ { 0, GDK_KEY_r, reload, { .i = 0 } },
++
++ { 0, GDK_KEY_l, navigate, { .i = +1 } },
++ { 0, GDK_KEY_h, navigate, { .i = -1 } },
+
+ /* vertical and horizontal scrolling, in viewport percentage */
+- { MODKEY, GDK_KEY_j, scrollv, { .i = +10 } },
+- { MODKEY, GDK_KEY_k, scrollv, { .i = -10 } },
+- { MODKEY, GDK_KEY_space, scrollv, { .i = +50 } },
+- { MODKEY, GDK_KEY_b, scrollv, { .i = -50 } },
+- { MODKEY, GDK_KEY_i, scrollh, { .i = +10 } },
+- { MODKEY, GDK_KEY_u, scrollh, { .i = -10 } },
++ { 0, GDK_KEY_j, scrollv, { .i = +10 } },
++ { 0, GDK_KEY_k, scrollv, { .i = -10 } },
++ { 0, GDK_KEY_space, scrollv, { .i = +50 } },
++ { 0, GDK_KEY_b, scrollv, { .i = -50 } },
++ { 0, GDK_KEY_i, scrollh, { .i = +10 } },
++ { 0, GDK_KEY_u, scrollh, { .i = -10 } },
+
+
+- { MODKEY|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } },
+- { MODKEY|GDK_SHIFT_MASK, GDK_KEY_k, zoom, { .i = +1 } },
+- { MODKEY|GDK_SHIFT_MASK, GDK_KEY_q, zoom, { .i = 0 } },
+- { MODKEY, GDK_KEY_minus, zoom, { .i = -1 } },
+- { MODKEY, GDK_KEY_plus, zoom, { .i = +1 } },
++ { 0|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } },
++ { 0|GDK_SHIFT_MASK, GDK_KEY_k, zoom, { .i = +1 } },
++ { 0|GDK_SHIFT_MASK, GDK_KEY_q, zoom, { .i = 0 } },
++ { 0, GDK_KEY_minus, zoom, { .i = -1 } },
++ { 0|GDK_SHIFT_MASK, GDK_KEY_plus, zoom, { .i = +1 } },
++ { 0, GDK_KEY_equal, zoom, { .i = 0 } },
+
+- { MODKEY, GDK_KEY_p, clipboard, { .i = 1 } },
+- { MODKEY, GDK_KEY_y, clipboard, { .i = 0 } },
++ { 0, GDK_KEY_p, clipboard, { .i = 1 } },
++ { 0, GDK_KEY_y, clipboard, { .i = 0 } },
+
+- { MODKEY, GDK_KEY_n, find, { .i = +1 } },
+- { MODKEY|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } },
++ { 0, GDK_KEY_n, find, { .i = +1 } },
++ { 0|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } },
+
+- { MODKEY|GDK_SHIFT_MASK, GDK_KEY_p, print, { 0 } },
++ { MODKEY, GDK_KEY_p, print, { 0 } },
+ { MODKEY, GDK_KEY_t, showcert, { 0 } },
+
+ { MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } },
+diff --git a/surf.c b/surf.c
+index 2b54e3c..f4cbe68 100644
+--- a/surf.c
++++ b/surf.c
+@@ -175,6 +175,7 @@ static void spawn(Client *c, const Arg *a);
+ static void msgext(Client *c, char type, const Arg *a);
+ static void destroyclient(Client *c);
+ static void cleanup(void);
++static int insertmode = 0;
+
+ /* GTK/WebKit */
+ static WebKitWebView *newview(Client *c, WebKitWebView *rv);
+@@ -231,6 +232,7 @@ 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 find(Client *c, const Arg *a);
++static void insert(Client *c, const Arg *a);
+
+ /* Buttons */
+ static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h);
+@@ -1333,7 +1335,11 @@ winevent(GtkWidget *w, GdkEvent *e, Client *c)
+ updatetitle(c);
+ break;
+ case GDK_KEY_PRESS:
+- if (!curconfig[KioskMode].val.i) {
++ if (!curconfig[KioskMode].val.i &&
++ !insertmode ||
++ CLEANMASK(e->key.state) == (MODKEY|GDK_SHIFT_MASK) ||
++ CLEANMASK(e->key.state) == (MODKEY) ||
++ gdk_keyval_to_lower(e->key.keyval) == (GDK_KEY_Escape)) {
+ for (i = 0; i < LENGTH(keys); ++i) {
+ if (gdk_keyval_to_lower(e->key.keyval) ==
+ keys[i].keyval &&
+@@ -1947,6 +1953,12 @@ find(Client *c, const Arg *a)
+ }
+ }
+
++void
++insert(Client *c, const Arg *a)
++{
++ insertmode = (a->i);
++}
++
+ void
+ clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h)
+ {
+--
+2.20.1
+
diff --git a/surf/patches/surf-notifications-20230403-665a709.diff b/surf/patches/surf-notifications-20230403-665a709.diff
new file mode 100644
index 0000000..9656138
--- /dev/null
+++ b/surf/patches/surf-notifications-20230403-665a709.diff
@@ -0,0 +1,106 @@
+From 3233530cdaa1dc06f007cfa54ee923b66b95dbf2 Mon Sep 17 00:00:00 2001
+From: Randolph Sapp <rs@ti.com>
+Date: Mon, 3 Apr 2023 15:29:39 -0500
+Subject: [PATCH] surf: update notifications patch for latest
+
+Update "notifications" patch for use with surf version
+665a709b522a6fa18c671f1fc41297603292d0e8
+
+Signed-off-by: Randolph Sapp <rs@ti.com>
+---
+ config.def.h | 2 ++
+ surf.c | 16 +++++++++++++++-
+ 2 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/config.def.h b/config.def.h
+index ca77061..12a598d 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -36,6 +36,7 @@ static Parameter defconfig[ParameterLast] = {
+ [KioskMode] = { { .i = 0 }, },
+ [LoadImages] = { { .i = 1 }, },
+ [MediaManualPlay] = { { .i = 1 }, },
++ [Notifications] = { { .i = 0 } },
+ [PreferredLanguages] = { { .v = (char *[]){ NULL } }, },
+ [RunInFullscreen] = { { .i = 0 }, },
+ [ScrollBars] = { { .i = 1 }, },
+@@ -178,6 +179,7 @@ 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_l, toggle, { .i = Notifications } },
+ { MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } },
+ { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } },
+ { MODKEY|GDK_SHIFT_MASK, GDK_KEY_d, toggle, { .i = DarkMode } },
+diff --git a/surf.c b/surf.c
+index 001f776..7d34c9b 100644
+--- a/surf.c
++++ b/surf.c
+@@ -72,6 +72,7 @@ typedef enum {
+ KioskMode,
+ LoadImages,
+ MediaManualPlay,
++ Notifications,
+ PreferredLanguages,
+ RunInFullscreen,
+ ScrollBars,
+@@ -245,7 +246,7 @@ static void clicknewwindow(Client *c, const Arg *a, WebKitHitTestResult *h);
+ static void clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h);
+
+ static char winid[64];
+-static char togglestats[11];
++static char togglestats[12];
+ static char pagestats[2];
+ static Atom atoms[AtomLast];
+ static Window embed;
+@@ -680,6 +681,7 @@ gettogglestats(Client *c)
+ togglestats[7] = curconfig[FrameFlattening].val.i ? 'F' : 'f';
+ togglestats[8] = curconfig[Certificate].val.i ? 'X' : 'x';
+ togglestats[9] = curconfig[StrictTLS].val.i ? 'T' : 't';
++ togglestats[10] = curconfig[Notifications].val.i ? 'L' : 'l';
+ }
+
+ void
+@@ -828,6 +830,9 @@ setparameter(Client *c, int refresh, ParamName p, const Arg *a)
+ webkit_settings_set_media_playback_requires_user_gesture(
+ c->settings, a->i);
+ break;
++ case Notifications:
++ refresh = 0;
++ return;
+ case PreferredLanguages:
+ return; /* do nothing */
+ case RunInFullscreen:
+@@ -1035,6 +1040,7 @@ newwindow(Client *c, const Arg *a, int noembed)
+ cmd[i++] = scriptfile;
+ }
+ cmd[i++] = curconfig[JavaScript].val.i ? "-S" : "-s";
++ cmd[i++] = curconfig[Notifications].val.i ? "-L" : "-l";
+ cmd[i++] = curconfig[StrictTLS].val.i ? "-T" : "-t";
+ if (fulluseragent && g_strcmp0(fulluseragent, "")) {
+ cmd[i++] = "-u";
+@@ -1628,6 +1634,8 @@ permissionrequested(WebKitWebView *v, WebKitPermissionRequest *r, Client *c)
+ else if (webkit_user_media_permission_is_for_video_device(
+ WEBKIT_USER_MEDIA_PERMISSION_REQUEST(r)))
+ param = AccessWebcam;
++ } else if (WEBKIT_IS_NOTIFICATION_PERMISSION_REQUEST(r)) {
++ param = Notifications;
+ } else {
+ return FALSE;
+ }
+@@ -2092,6 +2100,12 @@ main(int argc, char *argv[])
+ defconfig[KioskMode].val.i = 1;
+ defconfig[KioskMode].prio = 2;
+ break;
++ case 'l':
++ defconfig[Notifications].val.i = 0;
++ break;
++ case 'L':
++ defconfig[Notifications].val.i = 1;
++ break;
+ case 'm':
+ defconfig[Style].val.i = 0;
+ defconfig[Style].prio = 2;
+--
+2.40.0
+
diff --git a/surf/patches/surf-playexternal-20190724-b814567.diff b/surf/patches/surf-playexternal-20190724-b814567.diff
new file mode 100644
index 0000000..5c10b09
--- /dev/null
+++ b/surf/patches/surf-playexternal-20190724-b814567.diff
@@ -0,0 +1,54 @@
+From 95e17b5bd428173c83e60cec9cd5666cfe9066fa Mon Sep 17 00:00:00 2001
+From: DanMan <dnahimov@gmail.com>
+Date: Wed, 24 Jul 2019 18:47:46 -0400
+Subject: [PATCH] added playexternal hotkey function
+
+---
+ config.def.h | 2 ++
+ surf.c | 10 ++++++++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 6d3135e..5fa0d9d 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -105,6 +105,8 @@ static Key keys[] = {
+ { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") },
+ { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") },
+
++ { MODKEY, GDK_KEY_w, playexternal, { 0 } },
++
+ { 0, GDK_KEY_Escape, stop, { 0 } },
+ { MODKEY, GDK_KEY_c, stop, { 0 } },
+
+diff --git a/surf.c b/surf.c
+index 93a1629..e74e9df 100644
+--- a/surf.c
++++ b/surf.c
+@@ -217,6 +217,7 @@ 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 find(Client *c, const Arg *a);
++static void playexternal(Client *c, const Arg *a);
+
+ /* Buttons */
+ static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h);
+@@ -1648,6 +1649,15 @@ clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h)
+ spawn(c, &arg);
+ }
+
++void
++playexternal(Client *c, const Arg *a)
++{
++ Arg arg;
++
++ arg = (Arg)VIDEOPLAY(geturi(c));
++ spawn(c, &arg);
++}
++
+ int
+ main(int argc, char *argv[])
+ {
+--
+2.22.0
+
diff --git a/surf/patches/surf-quit_hotkey-20210830-11dca18.diff b/surf/patches/surf-quit_hotkey-20210830-11dca18.diff
new file mode 100644
index 0000000..e1ac6bb
--- /dev/null
+++ b/surf/patches/surf-quit_hotkey-20210830-11dca18.diff
@@ -0,0 +1,53 @@
+From bf390f44ba6de4aa6e30ab28a8ef51886e338d3e Mon Sep 17 00:00:00 2001
+From: z0gg3r <z0gg3r@users.no-reply.github.com>
+Date: Mon, 30 Aug 2021 21:24:52 +0200
+Subject: [PATCH] Adds new function quit that calls cleanup() and exit(0) and
+ assings q as hotkey to quit in config.def.h
+
+---
+ config.def.h | 2 ++
+ surf.c | 8 ++++++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 1355ba3..cf2fc68 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -136,6 +136,8 @@ static Key keys[] = {
+
+ { 0, GDK_KEY_Escape, stop, { 0 } },
+ { MODKEY, GDK_KEY_c, stop, { 0 } },
++
++ { 0, GDK_KEY_q, quit, { 0 } },
+
+ { MODKEY|GDK_SHIFT_MASK, GDK_KEY_r, reload, { .i = 1 } },
+ { MODKEY, GDK_KEY_r, reload, { .i = 0 } },
+diff --git a/surf.c b/surf.c
+index 03d8242..c0ba8ed 100644
+--- a/surf.c
++++ b/surf.c
+@@ -228,6 +228,7 @@ static void scrollv(Client *c, const Arg *a);
+ static void scrollh(Client *c, const Arg *a);
+ static void navigate(Client *c, const Arg *a);
+ static void stop(Client *c, const Arg *a);
++static void quit(Client *c, const Arg *a);
+ static void toggle(Client *c, const Arg *a);
+ static void togglefullscreen(Client *c, const Arg *a);
+ static void togglecookiepolicy(Client *c, const Arg *a);
+@@ -1901,6 +1902,13 @@ stop(Client *c, const Arg *a)
+ webkit_web_view_stop_loading(c->view);
+ }
+
++void
++quit(Client *c, const Arg *a)
++{
++ cleanup();
++ exit(0);
++}
++
+ void
+ toggle(Client *c, const Arg *a)
+ {
+--
+2.33.0
+
diff --git a/surf/patches/surf-scrollmultiply-2.0.diff b/surf/patches/surf-scrollmultiply-2.0.diff
new file mode 100644
index 0000000..22298eb
--- /dev/null
+++ b/surf/patches/surf-scrollmultiply-2.0.diff
@@ -0,0 +1,35 @@
+diff -up surf-2.0/surf.c surf/surf.c
+--- surf-2.0/surf.c 2018-04-13 10:55:11.036959113 +0200
++++ surf/surf.c 2018-04-14 12:12:41.519989478 +0200
+@@ -179,6 +179,8 @@ static void initwebextensions(WebKitWebC
+ static GtkWidget *createview(WebKitWebView *v, WebKitNavigationAction *a,
+ Client *c);
+ static gboolean buttonreleased(GtkWidget *w, GdkEvent *e, Client *c);
++static gboolean scrollmultiply(GtkWidget *w, GdkEvent *e, Client *c);
++
+ static GdkFilterReturn processx(GdkXEvent *xevent, GdkEvent *event,
+ gpointer d);
+ static gboolean winevent(GtkWidget *w, GdkEvent *e, Client *c);
+@@ -1152,6 +1154,8 @@ newview(Client *c, WebKitWebView *rv)
+ G_CALLBACK(titlechanged), c);
+ g_signal_connect(G_OBJECT(v), "button-release-event",
+ G_CALLBACK(buttonreleased), c);
++ g_signal_connect(G_OBJECT(v), "scroll-event",
++ G_CALLBACK(scrollmultiply), c);
+ g_signal_connect(G_OBJECT(v), "close",
+ G_CALLBACK(closeview), c);
+ g_signal_connect(G_OBJECT(v), "create",
+@@ -1229,6 +1233,13 @@ buttonreleased(GtkWidget *w, GdkEvent *e
+ return FALSE;
+ }
+
++gboolean
++scrollmultiply(GtkWidget *w, GdkEvent *e, Client *c)
++{
++ e->scroll.delta_y*=7;
++ return FALSE;
++}
++
+ GdkFilterReturn
+ processx(GdkXEvent *e, GdkEvent *event, gpointer d)
+ {
diff --git a/surf/patches/surf-searchengines-20220804-609ea1c.diff b/surf/patches/surf-searchengines-20220804-609ea1c.diff
new file mode 100644
index 0000000..32aca05
--- /dev/null
+++ b/surf/patches/surf-searchengines-20220804-609ea1c.diff
@@ -0,0 +1,94 @@
+From 2f64431f15777d93d146707dccdb6ad063c7a316 Mon Sep 17 00:00:00 2001
+From: Justinas Grigas <jstn_as@protonmail.com>
+Date: Thu, 4 Aug 2022 23:18:40 +0300
+Subject: [PATCH] searchengines: allows simple use of search engines
+
+The previous patches had some issues:
+* don't apply cleanly to the latest version.
+* a space between the token and query is implied, so having " " as a
+ token means you actually have to use " ". Or if your token is "e",
+ searching for "example.com" would trigger it. Now you specify the exact
+ token to look for.
+* has checks to skip badly configured search engines. The correct
+ solution is to configure them right.
+
+Now it works like a better version of the spacesearch patch, as it
+allows you to specify " " as a token
+---
+ config.def.h | 5 +++++
+ surf.c | 22 +++++++++++++++++++++-
+ 2 files changed, 26 insertions(+), 1 deletion(-)
+
+diff --git a/config.def.h b/config.def.h
+index 075f7d0..7bb9c46 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -8,6 +8,11 @@ static char *cachedir = "~/.local/share/surf/cache/";
+ static char *cookiefile = "~/.local/share/surf/cookies.txt";
+ static char *historyfile = "~/.local/share/surf/history.txt";
+
++static SearchEngine searchengines[] = {
++ { " ", "https://duckduckgo.com/?q=%s" },
++ { "osrs ", "https://oldschool.runescape.wiki/?search=%s" },
++};
++
+ /* Webkit default features */
+ /* Highest priority value will be used.
+ * Default parameters are priority 0
+diff --git a/surf.c b/surf.c
+index a2b507c..7e85952 100644
+--- a/surf.c
++++ b/surf.c
+@@ -133,6 +133,11 @@ typedef struct {
+ unsigned int stopevent;
+ } Button;
+
++typedef struct {
++ char *token;
++ char *uri;
++} SearchEngine;
++
+ typedef struct {
+ const char *uri;
+ Parameter config[ParameterLast];
+@@ -220,6 +225,7 @@ static void webprocessterminated(WebKitWebView *v,
+ Client *c);
+ static void closeview(WebKitWebView *v, Client *c);
+ static void destroywin(GtkWidget* w, Client *c);
++static gchar *parseuri(const gchar *uri);
+
+ /* Hotkeys */
+ static void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d);
+@@ -584,7 +590,7 @@ loaduri(Client *c, const Arg *a)
+ url = g_strdup_printf("file://%s", path);
+ free(path);
+ } else {
+- url = g_strdup_printf("http://%s", uri);
++ url = parseuri(uri);
+ }
+ if (apath != uri)
+ free(apath);
+@@ -1811,6 +1817,20 @@ destroywin(GtkWidget* w, Client *c)
+ gtk_main_quit();
+ }
+
++gchar *
++parseuri(const gchar *uri)
++{
++ guint i;
++
++ for (i = 0; i < LENGTH(searchengines); i++) {
++ if (g_str_has_prefix(uri, searchengines[i].token))
++ return g_strdup_printf(searchengines[i].uri,
++ uri + strlen(searchengines[i].token));
++ }
++
++ return g_strdup_printf("http://%s", uri);
++}
++
+ void
+ pasteuri(GtkClipboard *clipboard, const char *text, gpointer d)
+ {
+--
+2.37.1
+
diff --git a/surf/patches/surf-spacesearch-20170408-b814567.diff b/surf/patches/surf-spacesearch-20170408-b814567.diff
new file mode 100644
index 0000000..ad5c0fe
--- /dev/null
+++ b/surf/patches/surf-spacesearch-20170408-b814567.diff
@@ -0,0 +1,26 @@
+diff --git a/config.def.h b/config.def.h
+index 6d3135e..75dc6a6 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -153,6 +153,8 @@ static Key keys[] = {
+ { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } },
+ };
+
++static char *searchengine = "https://duckduckgo.com/?q=";
++
+ /* button definitions */
+ /* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */
+ static Button buttons[] = {
+diff --git a/surf.c b/surf.c
+index 93a1629..c20537e 100644
+--- a/surf.c
++++ b/surf.c
+@@ -476,6 +476,8 @@ loaduri(Client *c, const Arg *a)
+ } else if (!stat(uri, &st) && (path = realpath(uri, NULL))) {
+ url = g_strdup_printf("file://%s", path);
+ free(path);
++ } else if (*uri == ' ') {
++ url = g_strdup_printf("%s%s", searchengine, uri + 1);
+ } else {
+ url = g_strdup_printf("http://%s", uri);
+ }
diff --git a/surf/patches/surf-startgo-20200913-d068a38.diff b/surf/patches/surf-startgo-20200913-d068a38.diff
new file mode 100644
index 0000000..e592184
--- /dev/null
+++ b/surf/patches/surf-startgo-20200913-d068a38.diff
@@ -0,0 +1,78 @@
+From 950f05fca48ab3adf0ec955b06c8e7dad3ee2c32 Mon Sep 17 00:00:00 2001
+From: Luca Wellmeier <luca_wellmeier@gmx.de>
+Date: Sun, 13 Sep 2020 11:33:25 +0200
+Subject: [PATCH] add option to start the go prompt immediately after startup
+
+---
+ config.def.h | 3 +++
+ surf.1 | 5 ++++-
+ surf.c | 9 +++++++++
+ 3 files changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/config.def.h b/config.def.h
+index 34265f6..3da943d 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -7,6 +7,9 @@ static char *certdir = "~/.surf/certificates/";
+ static char *cachedir = "~/.surf/cache/";
+ static char *cookiefile = "~/.surf/cookies.txt";
+
++/* enable to open GO prompt on startup */
++static int startgo = 0;
++
+ /* Webkit default features */
+ /* Highest priority value will be used.
+ * Default parameters are priority 0
+diff --git a/surf.1 b/surf.1
+index 45c31bb..54f2dbd 100644
+--- a/surf.1
++++ b/surf.1
+@@ -3,7 +3,7 @@
+ surf \- simple webkit-based browser
+ .SH SYNOPSIS
+ .B surf
+-.RB [-bBdDfFgGiIkKmMnNpPsStTvwxX]
++.RB [-bBdDfFgGhiIkKmMnNpPsStTvwxX]
+ .RB [-a\ cookiepolicies]
+ .RB [-c\ cookiefile]
+ .RB [-C\ stylefile]
+@@ -67,6 +67,9 @@ Disable giving the geolocation to websites.
+ .B \-G
+ Enable giving the geolocation to websites.
+ .TP
++.B \-h
++Start the GO prompt immediately.
++.TP
+ .B \-i
+ Disable Images.
+ .TP
+diff --git a/surf.c b/surf.c
+index 2b54e3c..f5fae45 100644
+--- a/surf.c
++++ b/surf.c
+@@ -2026,6 +2026,9 @@ main(int argc, char *argv[])
+ defconfig[Geolocation].val.i = 1;
+ defconfig[Geolocation].prio = 2;
+ break;
++ case 'h':
++ startgo = 1;
++ break;
+ case 'i':
+ defconfig[LoadImages].val.i = 0;
+ defconfig[LoadImages].prio = 2;
+@@ -2120,6 +2123,12 @@ main(int argc, char *argv[])
+ loaduri(c, &arg);
+ updatetitle(c);
+
++ if (startgo) {
++ /* start directly into GO prompt */
++ Arg a = (Arg)SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO);
++ spawn(c, &a);
++ }
++
+ gtk_main();
+ cleanup();
+
+--
+2.28.0
+
diff --git a/surf/patches/surf-uri-aliases-20220930-089272b.diff b/surf/patches/surf-uri-aliases-20220930-089272b.diff
new file mode 100644
index 0000000..98ed58d
--- /dev/null
+++ b/surf/patches/surf-uri-aliases-20220930-089272b.diff
@@ -0,0 +1,58 @@
+From 089272be1459bc91800215d39f483a2584ae99cc Mon Sep 17 00:00:00 2001
+From: r4v10l1 <29655971+r4v10l1@users.noreply.github.com>
+Date: Fri, 30 Sep 2022 18:59:15 +0200
+Subject: [PATCH] Alias patch
+
+---
+ config.def.h | 7 +++++++
+ surf.c | 12 ++++++++++++
+ 2 files changed, 19 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 93cfeeb..2b19183 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -194,3 +194,10 @@ static Button buttons[] = {
+ { OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 },
+ { OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 },
+ };
++
++/* Put here your aliases */
++static Alias aliases[] = {
++ /* Alias URI */
++ { "ddg", "https://duckduckgo.com" },
++ { "wikipedia", "https://www.wikipedia.org" }
++};
+diff --git a/surf.c b/surf.c
+index 474c01b..25f8528 100644
+--- a/surf.c
++++ b/surf.c
+@@ -144,6 +144,11 @@ typedef struct {
+ regex_t re;
+ } SiteSpecific;
+
++typedef struct {
++ const char* alias;
++ const char* uri;
++} Alias;
++
+ /* Surf */
+ static void die(const char *errstr, ...);
+ static void usage(void);
+@@ -567,6 +572,13 @@ loaduri(Client *c, const Arg *a)
+ if (g_strcmp0(uri, "") == 0)
+ return;
+
++ for (int i = 0; i < LENGTH(aliases); i++) {
++ if (strcmp(aliases[i].alias, uri) == 0) {
++ uri = aliases[i].uri;
++ break;
++ }
++ }
++
+ if (g_str_has_prefix(uri, "http://") ||
+ g_str_has_prefix(uri, "https://") ||
+ g_str_has_prefix(uri, "file://") ||
+--
+2.37.3
+
diff --git a/surf/patches/surf-xdg-2.0.diff b/surf/patches/surf-xdg-2.0.diff
new file mode 100644
index 0000000..044c28b
--- /dev/null
+++ b/surf/patches/surf-xdg-2.0.diff
@@ -0,0 +1,159 @@
+From 0f88df661a00f4b2ea5b0547d23ac07f2f95d12f Mon Sep 17 00:00:00 2001
+From: Aidan Hall <aidan.hall@outlook.com>
+Date: Mon, 22 Feb 2021 17:21:59 +0000
+Subject: [PATCH 1/3] Added xdg icon and menu entries.
+
+---
+ Makefile | 8 ++++++++
+ suckless-surf-open.desktop | 13 +++++++++++++
+ suckless-surf-open.directory | 4 ++++
+ suckless-surf.desktop | 12 ++++++++++++
+ suckless-surf.directory | 4 ++++
+ 5 files changed, 41 insertions(+)
+ create mode 100644 suckless-surf-open.desktop
+ create mode 100644 suckless-surf-open.directory
+ create mode 100644 suckless-surf.desktop
+ create mode 100644 suckless-surf.directory
+
+diff --git a/Makefile b/Makefile
+index e5d4172..168d2df 100644
+--- a/Makefile
++++ b/Makefile
+@@ -64,6 +64,11 @@ install: all
+ mkdir -p $(DESTDIR)$(MANPREFIX)/man1
+ sed "s/VERSION/$(VERSION)/g" < surf.1 > $(DESTDIR)$(MANPREFIX)/man1/surf.1
+ chmod 644 $(DESTDIR)$(MANPREFIX)/man1/surf.1
++ cp surf.png suckless-surf.png
++ xdg-icon-resource install --size 128 suckless-surf.png
++ rm suckless-surf.png
++ xdg-desktop-menu install ./suckless-surf.directory ./suckless-surf.desktop
++ xdg-desktop-menu install ./suckless-surf-open.directory ./suckless-surf-open.desktop
+
+ uninstall:
+ rm -f $(DESTDIR)$(PREFIX)/bin/surf
+@@ -72,5 +77,8 @@ uninstall:
+ rm -f $(DESTDIR)$(LIBDIR)/$$wlib; \
+ done
+ - rmdir $(DESTDIR)$(LIBDIR)
++ xdg-desktop-menu uninstall suckless-surf.directory suckless-surf.desktop
++ xdg-desktop-menu uninstall suckless-surf-open.directory suckless-surf-open.desktop
++ xdg-icon-resource uninstall --size 128 suckless-surf.png
+
+ .PHONY: all options distclean clean dist install uninstall
+diff --git a/suckless-surf-open.desktop b/suckless-surf-open.desktop
+new file mode 100644
+index 0000000..f8ca41f
+--- /dev/null
++++ b/suckless-surf-open.desktop
+@@ -0,0 +1,13 @@
++[Desktop Entry]
++Version=2.0
++Name=surf-open
++Icon=suckless-surf
++GenericName=Web Browser
++Comment=A simple web browser based on WebKit2/GTK+, with tabbed.
++Keywords=Internet;WWW;Browser;Web;Explorer
++Exec=/usr/local/bin/surf-open %u
++Terminal=false
++Type=Application
++MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;
++Categories=Network;WebBrowser;
++
+diff --git a/suckless-surf-open.directory b/suckless-surf-open.directory
+new file mode 100644
+index 0000000..e7b298e
+--- /dev/null
++++ b/suckless-surf-open.directory
+@@ -0,0 +1,4 @@
++[Desktop Entry]
++Name=surf
++Icon=surf
++Type=Directory
+diff --git a/suckless-surf.desktop b/suckless-surf.desktop
+new file mode 100644
+index 0000000..6ba56b6
+--- /dev/null
++++ b/suckless-surf.desktop
+@@ -0,0 +1,12 @@
++[Desktop Entry]
++Version=2.0
++Name=surf
++Icon=suckless-surf
++GenericName=Web Browser
++Comment=A simple web browser based on WebKit2/GTK+.
++Keywords=Internet;WWW;Browser;Web;Explorer
++Exec=/usr/local/bin/surf %u
++Terminal=false
++Type=Application
++MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;
++Categories=Network;WebBrowser;
+diff --git a/suckless-surf.directory b/suckless-surf.directory
+new file mode 100644
+index 0000000..e7b298e
+--- /dev/null
++++ b/suckless-surf.directory
+@@ -0,0 +1,4 @@
++[Desktop Entry]
++Name=surf
++Icon=surf
++Type=Directory
+--
+2.30.0
+
+
+From 1068a3506626c4900681154165391f4527a47864 Mon Sep 17 00:00:00 2001
+From: Aidan Hall <aidan.hall@outlook.com>
+Date: Mon, 22 Feb 2021 17:25:31 +0000
+Subject: [PATCH 2/3] Fixed icons for directory files.
+
+---
+ suckless-surf-open.directory | 2 +-
+ suckless-surf.directory | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/suckless-surf-open.directory b/suckless-surf-open.directory
+index e7b298e..53f0fbe 100644
+--- a/suckless-surf-open.directory
++++ b/suckless-surf-open.directory
+@@ -1,4 +1,4 @@
+ [Desktop Entry]
+ Name=surf
+-Icon=surf
++Icon=suckless-surf
+ Type=Directory
+diff --git a/suckless-surf.directory b/suckless-surf.directory
+index e7b298e..53f0fbe 100644
+--- a/suckless-surf.directory
++++ b/suckless-surf.directory
+@@ -1,4 +1,4 @@
+ [Desktop Entry]
+ Name=surf
+-Icon=surf
++Icon=suckless-surf
+ Type=Directory
+--
+2.30.0
+
+
+From 003e132c154a7aa985a3bb353c5f2ab70cbcb43f Mon Sep 17 00:00:00 2001
+From: Aidan Hall <aidan.hall@outlook.com>
+Date: Mon, 22 Feb 2021 17:27:30 +0000
+Subject: [PATCH 3/3] Fixed name for suckless-surf-open.directory.
+
+---
+ suckless-surf-open.directory | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/suckless-surf-open.directory b/suckless-surf-open.directory
+index 53f0fbe..72ab23e 100644
+--- a/suckless-surf-open.directory
++++ b/suckless-surf-open.directory
+@@ -1,4 +1,4 @@
+ [Desktop Entry]
+-Name=surf
++Name=surf-open
+ Icon=suckless-surf
+ Type=Directory
+--
+2.30.0
+
diff --git a/surf/patches/surf-zoommtghandler-2.1.diff b/surf/patches/surf-zoommtghandler-2.1.diff
new file mode 100644
index 0000000..ffd4b02
--- /dev/null
+++ b/surf/patches/surf-zoommtghandler-2.1.diff
@@ -0,0 +1,69 @@
+From 47c1ddc06052c5a86aaab8bc4a5a3fe59995b30b Mon Sep 17 00:00:00 2001
+From: Lars Niesen <lars.niesen@gmx.de>
+Date: Thu, 9 Dec 2021 14:42:13 +0100
+Subject: [PATCH] added zoommtg scheme handler
+
+---
+ surf.c | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+diff --git a/surf.c b/surf.c
+index af0fa74..338045c 100644
+--- a/surf.c
++++ b/surf.c
+@@ -217,6 +217,8 @@ static void webprocessterminated(WebKitWebView *v,
+ static void closeview(WebKitWebView *v, Client *c);
+ static void destroywin(GtkWidget* w, Client *c);
+
++static void handle_zoommtg(WebKitURISchemeRequest *request);
++
+ /* Hotkeys */
+ static void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d);
+ static void reload(Client *c, const Arg *a);
+@@ -562,6 +564,7 @@ loaduri(Client *c, const Arg *a)
+ if (g_strcmp0(uri, "") == 0)
+ return;
+
++
+ if (g_str_has_prefix(uri, "http://") ||
+ g_str_has_prefix(uri, "https://") ||
+ g_str_has_prefix(uri, "file://") ||
+@@ -1182,6 +1185,9 @@ newview(Client *c, WebKitWebView *rv)
+ g_signal_connect(G_OBJECT(context), "initialize-web-extensions",
+ G_CALLBACK(initwebextensions), c);
+
++ webkit_web_context_register_uri_scheme(context, "zoommtg",
++ (WebKitURISchemeRequestCallback)handle_zoommtg, NULL, NULL);
++
+ v = g_object_new(WEBKIT_TYPE_WEB_VIEW,
+ "settings", settings,
+ "user-content-manager", contentmanager,
+@@ -1776,6 +1782,25 @@ destroywin(GtkWidget* w, Client *c)
+ gtk_main_quit();
+ }
+
++void
++handle_zoommtg(WebKitURISchemeRequest *request)
++{
++ char* uri = webkit_uri_scheme_request_get_uri (request);
++ Arg a = (Arg)PLUMB(uri);
++ printf("handleplumb: %s",(char*)a.v);
++ if (fork() == 0) {
++ if (dpy)
++ close(ConnectionNumber(dpy));
++ close(spair[0]);
++ close(spair[1]);
++ setsid();
++ execvp(((char **)a.v)[0], (char **)a.v);
++ fprintf(stderr, "%s: execvp %s", argv0, ((char **)a.v)[0]);
++ perror(" failed");
++ exit(1);
++ }
++}
++
+ void
+ pasteuri(GtkClipboard *clipboard, const char *text, gpointer d)
+ {
+--
+2.34.1
+