diff options
Diffstat (limited to 'dwl-patches/patches/define-modkey-with-make-argument')
-rw-r--r-- | dwl-patches/patches/define-modkey-with-make-argument/README.md | 18 | ||||
-rw-r--r-- | dwl-patches/patches/define-modkey-with-make-argument/define-modkey-with-make-argument.patch | 49 |
2 files changed, 67 insertions, 0 deletions
diff --git a/dwl-patches/patches/define-modkey-with-make-argument/README.md b/dwl-patches/patches/define-modkey-with-make-argument/README.md new file mode 100644 index 0000000..2fac947 --- /dev/null +++ b/dwl-patches/patches/define-modkey-with-make-argument/README.md @@ -0,0 +1,18 @@ +### Description
+This patch adds the ability to define the modkey with a make argument like so:
+
+```
+make MODKEY=WLR_MODIFIER_ALT
+make MODKEY=WLR_MODIFIER_LOGO
+make MODKEY=WLR_MODIFIER_CTRL
+make MODKEY=WLR_MODIFIER_SHIFT
+```
+
+It can be used to compile multiple times quickly, you can also have a main session and sub session with different modkeys.
+
+### Download
+- [git branch](https://codeberg.org/Abanoub/dwl/src/branch/define-modkey-patch)
+- [2024-02-14](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/define-modkey-with-make-argument/define-modkey-with-make-argument.patch)
+
+### Authors
+- [Abanoub](https://codeberg.org/Abanoub)
diff --git a/dwl-patches/patches/define-modkey-with-make-argument/define-modkey-with-make-argument.patch b/dwl-patches/patches/define-modkey-with-make-argument/define-modkey-with-make-argument.patch new file mode 100644 index 0000000..86faf11 --- /dev/null +++ b/dwl-patches/patches/define-modkey-with-make-argument/define-modkey-with-make-argument.patch @@ -0,0 +1,49 @@ +From ec6a6a4fe56ef5bdf45633966345f0d0338776d5 Mon Sep 17 00:00:00 2001 +From: Abanoub <abanoubsameh@protonmail.com> +Date: Fri, 19 Jan 2024 21:42:42 +0200 +Subject: [PATCH] Add the ability to define a MODKEY as a make argument + +--- + Makefile | 6 +++++- + config.def.h | 4 +++- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 0822ddc..d169a97 100644 +--- a/Makefile ++++ b/Makefile +@@ -13,6 +13,10 @@ PKGS = wlroots wayland-server xkbcommon libinput $(XLIBS) + DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS) + LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS) + ++ifneq ($(MODKEY),) ++MODKEYVAL = -DMODKEY=$(MODKEY) ++endif ++ + all: dwl + dwl: dwl.o util.o + $(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@ +@@ -63,4 +67,4 @@ uninstall: + + .SUFFIXES: .c .o + .c.o: +- $(CC) $(CPPFLAGS) $(DWLCFLAGS) -c $< ++ $(CC) $(CPPFLAGS) $(DWLCFLAGS) $(MODKEYVAL) -c $< +diff --git a/config.def.h b/config.def.h +index 9009517..b1e53cd 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -102,7 +102,9 @@ LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right + static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM; + + /* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */ +-#define MODKEY WLR_MODIFIER_ALT ++#ifndef MODKEY ++# define MODKEY WLR_MODIFIER_ALT ++#endif + + #define TAGKEYS(KEY,SKEY,TAG) \ + { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ +-- +2.43.0 + |