mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2026-03-22 00:41:30 +00:00
swapandfocusdir: update for 0.8 and abandoned patch adopted by unixchad
This commit is contained in:
parent
898bc7a946
commit
58e371fcb3
@ -6,9 +6,11 @@ Swap the focused window with the window (no floating) to the left, right, above,
|
||||
**NOTE:** this patch uses the same algorithm that River uses to select the window in the given direction.
|
||||
|
||||
### Download
|
||||
- [v0.8](https://codeberg.org/dwl/dwl-patches/raw/commit/a5f66f3d9cdbfc1a3fd7ae9c0288c35c8ec19479/patches/swapandfocusdir/swapandfocusdir.patch)
|
||||
- [git branch](https://codeberg.org/wochap/dwl/src/branch/v0.5/swapandfocusdir)
|
||||
- [2024-07-09](https://codeberg.org/dwl/dwl-patches/raw/commit/13d96b51b54500dd24544cf3a73c61b7a1414bc6/patches/swapandfocusdir/swapandfocusdir.patch)
|
||||
- [v0.5](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/swapandfocusdir/swapandfocusdir.patch)
|
||||
|
||||
### Authors
|
||||
- [unixchad](https://codeberg.org/unixchad)
|
||||
- [wochap](https://codeberg.org/wochap)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
From 285470897406b653e77d732a77356aaf9a70b799 Mon Sep 17 00:00:00 2001
|
||||
From: wochap <gean.marroquin@gmail.com>
|
||||
Date: Fri, 5 Jul 2024 12:37:39 -0500
|
||||
Subject: [PATCH] implement swapandfocusdir
|
||||
From 6972f383921a892e30ac10b42a3d3ce47b2f93e5 Mon Sep 17 00:00:00 2001
|
||||
From: nate zhou <gnuunixchad@outlook.com>
|
||||
Date: Sat, 28 Feb 2026 20:48:27 +0800
|
||||
Subject: [PATCH] Patch: swapandfocusdir.patch
|
||||
|
||||
---
|
||||
config.def.h | 8 +++
|
||||
@ -9,29 +9,29 @@ Subject: [PATCH] implement swapandfocusdir
|
||||
2 files changed, 172 insertions(+)
|
||||
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 22d2171..724e15e 100644
|
||||
index 8a6eda0..6e7fc39 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -129,6 +129,14 @@ static const Key keys[] = {
|
||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
|
||||
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
|
||||
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
||||
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Left, focusdir, {.ui = 0} },
|
||||
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Right, focusdir, {.ui = 1} },
|
||||
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Up, focusdir, {.ui = 2} },
|
||||
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Down, focusdir, {.ui = 3} },
|
||||
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Left, swapdir, {.ui = 0} },
|
||||
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Right, swapdir, {.ui = 1} },
|
||||
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Up, swapdir, {.ui = 2} },
|
||||
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Down, swapdir, {.ui = 3} },
|
||||
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
|
||||
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
|
||||
@@ -125,6 +125,14 @@ static const Key keys[] = {
|
||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
|
||||
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
|
||||
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
||||
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Left, focusdir, {.ui = 0} },
|
||||
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Right, focusdir, {.ui = 1} },
|
||||
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Up, focusdir, {.ui = 2} },
|
||||
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Down, focusdir, {.ui = 3} },
|
||||
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Left, swapdir, {.ui = 0} },
|
||||
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Right, swapdir, {.ui = 1} },
|
||||
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Up, swapdir, {.ui = 2} },
|
||||
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Down, swapdir, {.ui = 3} },
|
||||
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
|
||||
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index dc0437e..844c1f5 100644
|
||||
index 44f3ad9..1893fbd 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -241,6 +241,11 @@ typedef struct {
|
||||
@@ -239,6 +239,11 @@ typedef struct {
|
||||
struct wl_listener destroy;
|
||||
} SessionLock;
|
||||
|
||||
@ -51,8 +51,8 @@ index dc0437e..844c1f5 100644
|
||||
+static void swapdir(const Arg *arg);
|
||||
static Client *focustop(Monitor *m);
|
||||
static void fullscreennotify(struct wl_listener *listener, void *data);
|
||||
static void handlesig(int signo);
|
||||
@@ -1425,6 +1432,163 @@ focusstack(const Arg *arg)
|
||||
static void gpureset(struct wl_listener *listener, void *data);
|
||||
@@ -1511,6 +1518,163 @@ focusstack(const Arg *arg)
|
||||
focusclient(c, 1);
|
||||
}
|
||||
|
||||
@ -213,9 +213,9 @@ index dc0437e..844c1f5 100644
|
||||
+ arrange(selmon);
|
||||
+}
|
||||
+
|
||||
/* We probably should change the name of this, it sounds like
|
||||
/* We probably should change the name of this: it sounds like it
|
||||
* will focus the topmost client of this mon, when actually will
|
||||
* only return that client */
|
||||
--
|
||||
2.45.1
|
||||
2.53.0
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user