[wiki] [sites] Surf patch that adds a quit function || z0gg3r

From: <git_AT_suckless.org>
Date: Mon, 30 Aug 2021 21:48:01 +0200

commit 309436705689dfaffb94c4d2001138b61e52ea07
Author: z0gg3r <z0gg3r_AT_users.no-reply.github.com>
Date: Mon Aug 30 21:44:05 2021 +0200

    Surf patch that adds a quit function
    
    This just adds a simple quit function that first calls cleanup and then exit(0)
    and a adds 'q' as a hotkey in config.def.h to call the new function.

diff --git a/surf.suckless.org/patches/quit-hotkey/index.md b/surf.suckless.org/patches/quit-hotkey/index.md
new file mode 100644
index 00000000..ab1ee03c
--- /dev/null
+++ b/surf.suckless.org/patches/quit-hotkey/index.md
_AT_@ -0,0 +1,19 @@
+quit hotkey
+===================
+
+Description
+-----------
+
+This patch adds a quit function to surf.c and adds 'q' as a hotkey to quit in
+the config.def.h file.
+
+Download
+--------
+
+* [surf-quithotkey-20210830-11dca18.diff](surf-quithotkey-20210830-11dca18.diff)
+ (4.0k)
+
+Author
+------
+
+* zocker <zockerfreunde03.info_AT_gmx.de>
diff --git a/surf.suckless.org/patches/quit-hotkey/surf-quit_hotkey-20210830-11dca18.diff b/surf.suckless.org/patches/quit-hotkey/surf-quit_hotkey-20210830-11dca18.diff
new file mode 100644
index 00000000..e1ac6bb1
--- /dev/null
+++ b/surf.suckless.org/patches/quit-hotkey/surf-quit_hotkey-20210830-11dca18.diff
_AT_@ -0,0 +1,53 @@
+From bf390f44ba6de4aa6e30ab28a8ef51886e338d3e Mon Sep 17 00:00:00 2001
+From: z0gg3r <z0gg3r_AT_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
+_AT_@ -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
+_AT_@ -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);
+_AT_@ -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
+
Received on Mon Aug 30 2021 - 21:48:01 CEST

This archive was generated by hypermail 2.3.0 : Mon Aug 30 2021 - 21:48:47 CEST