sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

st-configdefh-20220227-1461317.diff (2093B)


      1 From 14613172141adaa17c3cc1b4b67d6bbc90b25905 Mon Sep 17 00:00:00 2001
      2 From: Rebecca White <rtiannew@outlook.com>
      3 Date: Sun, 27 Feb 2022 15:07:38 +0000
      4 Subject: [PATCH] Use config.def.h Instead of config.h
      5 
      6 Use 'config.def.h' instead of using the 'config.h' file for
      7 configuration. This avoids conflicts with other patches that use
      8 'config.def.h'
      9 ---
     10  Makefile |  9 +++------
     11  x.c      | 10 +++++-----
     12  2 files changed, 8 insertions(+), 11 deletions(-)
     13 
     14 diff --git a/Makefile b/Makefile
     15 index 470ac86..ab1d9b8 100644
     16 --- a/Makefile
     17 +++ b/Makefile
     18 @@ -15,16 +15,13 @@ options:
     19  	@echo "LDFLAGS = $(STLDFLAGS)"
     20  	@echo "CC      = $(CC)"
     21  
     22 -config.h:
     23 -	cp config.def.h config.h
     24 -
     25  .c.o:
     26  	$(CC) $(STCFLAGS) -c $<
     27  
     28 -st.o: config.h st.h win.h
     29 -x.o: arg.h config.h st.h win.h
     30 +st.o: config.def.h st.h win.h
     31 +x.o: arg.h config.def.h st.h win.h
     32  
     33 -$(OBJ): config.h config.mk
     34 +$(OBJ): config.def.h config.mk
     35  
     36  st: $(OBJ)
     37  	$(CC) -o $@ $(OBJ) $(STLDFLAGS)
     38 diff --git a/x.c b/x.c
     39 index cd96575..0c78b1a 100644
     40 --- a/x.c
     41 +++ b/x.c
     42 @@ -20,7 +20,7 @@ char *argv0;
     43  #include "st.h"
     44  #include "win.h"
     45  
     46 -/* types used in config.h */
     47 +/* types used in config.def.h */
     48  typedef struct {
     49  	uint mod;
     50  	KeySym keysym;
     51 @@ -50,7 +50,7 @@ typedef struct {
     52  #define XK_NO_MOD     0
     53  #define XK_SWITCH_MOD (1<<13|1<<14)
     54  
     55 -/* function definitions used in config.h */
     56 +/* function definitions used in config.def.h */
     57  static void clipcopy(const Arg *);
     58  static void clippaste(const Arg *);
     59  static void numlock(const Arg *);
     60 @@ -60,8 +60,8 @@ static void zoomabs(const Arg *);
     61  static void zoomreset(const Arg *);
     62  static void ttysend(const Arg *);
     63  
     64 -/* config.h for applying patches and the configuration. */
     65 -#include "config.h"
     66 +/* config.def.h for applying patches and the configuration. */
     67 +#include "config.def.h"
     68  
     69  /* XEMBED messages */
     70  #define XEMBED_FOCUS_IN  4
     71 @@ -1855,7 +1855,7 @@ kpress(XEvent *ev)
     72  		}
     73  	}
     74  
     75 -	/* 2. custom keys from config.h */
     76 +	/* 2. custom keys from config.def.h */
     77  	if ((customkey = kmap(ksym, e->state))) {
     78  		ttywrite(customkey, strlen(customkey), 1);
     79  		return;
     80 -- 
     81 2.35.1
     82