[wiki] [sites] ST Patch: 'config.def.h' || Rebecca Taylor

From: <git_AT_suckless.org>
Date: Sun, 27 Feb 2022 16:15:02 +0100

commit 069b1c785e4429182c6d7efd2ea35a81f2810a4c
Author: Rebecca Taylor <rtiannew_AT_outlook.com>
Date: Sun Feb 27 15:11:29 2022 +0000

    ST Patch: 'config.def.h'
    
    This patch allows the usage of 'config.def.h' as the primary
    configuration file, instead of 'config.h'. This avoids conflicts with
    other patches that use 'config.def.h', and avoids confusion when the
    user adds a new patch and doesn't see the patch because they forgot to
    remove 'config.h'

diff --git a/st.suckless.org/patches/configdefh/index.md b/st.suckless.org/patches/configdefh/index.md
new file mode 100644
index 00000000..2eae865f
--- /dev/null
+++ b/st.suckless.org/patches/configdefh/index.md
_AT_@ -0,0 +1,15 @@
+configdefh
+===========
+
+Description
+-----------
+
+This patch allows you to use the `config.def.h` file as your config rather than the `config.h` file, making it easier to apply other patches as you no longer need to worry about conflicts with `config.h`.
+
+Download
+---------
+* [st-configdefh-20220227-1461317.diff](st-configdefh-20220227-1461317.diff)
+
+Authors
+-------
+* Rebecca Taylor <rtiannew_AT_outlook.com>
diff --git a/st.suckless.org/patches/configdefh/st-configdefh-20220227-1461317.diff b/st.suckless.org/patches/configdefh/st-configdefh-20220227-1461317.diff
new file mode 100644
index 00000000..1c8356f9
--- /dev/null
+++ b/st.suckless.org/patches/configdefh/st-configdefh-20220227-1461317.diff
_AT_@ -0,0 +1,82 @@
+From 14613172141adaa17c3cc1b4b67d6bbc90b25905 Mon Sep 17 00:00:00 2001
+From: Rebecca White <rtiannew_AT_outlook.com>
+Date: Sun, 27 Feb 2022 15:07:38 +0000
+Subject: [PATCH] Use config.def.h Instead of config.h
+
+Use 'config.def.h' instead of using the 'config.h' file for
+configuration. This avoids conflicts with other patches that use
+'config.def.h'
+---
+ Makefile | 9 +++------
+ x.c | 10 +++++-----
+ 2 files changed, 8 insertions(+), 11 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 470ac86..ab1d9b8 100644
+--- a/Makefile
++++ b/Makefile
+_AT_@ -15,16 +15,13 @@ options:
+ _AT_echo "LDFLAGS = $(STLDFLAGS)"
+ _AT_echo "CC = $(CC)"
+
+-config.h:
+- cp config.def.h config.h
+-
+ .c.o:
+ $(CC) $(STCFLAGS) -c $<
+
+-st.o: config.h st.h win.h
+-x.o: arg.h config.h st.h win.h
++st.o: config.def.h st.h win.h
++x.o: arg.h config.def.h st.h win.h
+
+-$(OBJ): config.h config.mk
++$(OBJ): config.def.h config.mk
+
+ st: $(OBJ)
+ $(CC) -o $_AT_ $(OBJ) $(STLDFLAGS)
+diff --git a/x.c b/x.c
+index cd96575..0c78b1a 100644
+--- a/x.c
++++ b/x.c
+_AT_@ -20,7 +20,7 @@ char *argv0;
+ #include "st.h"
+ #include "win.h"
+
+-/* types used in config.h */
++/* types used in config.def.h */
+ typedef struct {
+ uint mod;
+ KeySym keysym;
+_AT_@ -50,7 +50,7 @@ typedef struct {
+ #define XK_NO_MOD 0
+ #define XK_SWITCH_MOD (1<<13|1<<14)
+
+-/* function definitions used in config.h */
++/* function definitions used in config.def.h */
+ static void clipcopy(const Arg *);
+ static void clippaste(const Arg *);
+ static void numlock(const Arg *);
+_AT_@ -60,8 +60,8 @@ static void zoomabs(const Arg *);
+ static void zoomreset(const Arg *);
+ static void ttysend(const Arg *);
+
+-/* config.h for applying patches and the configuration. */
+-#include "config.h"
++/* config.def.h for applying patches and the configuration. */
++#include "config.def.h"
+
+ /* XEMBED messages */
+ #define XEMBED_FOCUS_IN 4
+_AT_@ -1855,7 +1855,7 @@ kpress(XEvent *ev)
+ }
+ }
+
+- /* 2. custom keys from config.h */
++ /* 2. custom keys from config.def.h */
+ if ((customkey = kmap(ksym, e->state))) {
+ ttywrite(customkey, strlen(customkey), 1);
+ return;
+--
+2.35.1
+
Received on Sun Feb 27 2022 - 16:15:02 CET

This archive was generated by hypermail 2.3.0 : Sun Feb 27 2022 - 16:24:58 CET