mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-10-26 17:54:17 +00:00
update dimkr patches
This commit is contained in:
parent
1bbf778597
commit
59e4dd61f3
36
env/env.patch
vendored
36
env/env.patch
vendored
@ -1,18 +1,18 @@
|
|||||||
From f51bfab9b90536518a8f2eb9ac9ecb082bcf270d Mon Sep 17 00:00:00 2001
|
From a822ac65306ca331b95b17ffe08147110c03c60d Mon Sep 17 00:00:00 2001
|
||||||
From: Dima Krasner <dima@dimakrasner.com>
|
From: Dima Krasner <dima@dimakrasner.com>
|
||||||
Date: Sat, 25 Nov 2023 11:55:58 +0200
|
Date: Sat, 30 Dec 2023 10:49:48 +0200
|
||||||
Subject: [PATCH] allow environment variables to override config.h
|
Subject: [PATCH] allow environment variables to override config.h
|
||||||
|
|
||||||
---
|
---
|
||||||
Makefile | 1 +
|
Makefile | 1 +
|
||||||
config.def.h | 9 ++-
|
config.def.h | 10 +--
|
||||||
dwl.c | 5 ++
|
dwl.c | 5 ++
|
||||||
env.c | 217 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
env.c | 217 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
4 files changed, 228 insertions(+), 4 deletions(-)
|
4 files changed, 228 insertions(+), 5 deletions(-)
|
||||||
create mode 100644 env.c
|
create mode 100644 env.c
|
||||||
|
|
||||||
diff --git a/Makefile b/Makefile
|
diff --git a/Makefile b/Makefile
|
||||||
index f0ff805..506ed09 100644
|
index 0822ddc..fbdfdca 100644
|
||||||
--- a/Makefile
|
--- a/Makefile
|
||||||
+++ b/Makefile
|
+++ b/Makefile
|
||||||
@@ -17,6 +17,7 @@ all: dwl
|
@@ -17,6 +17,7 @@ all: dwl
|
||||||
@ -24,30 +24,31 @@ index f0ff805..506ed09 100644
|
|||||||
|
|
||||||
# wayland-scanner is a tool which generates C headers and rigging for Wayland
|
# wayland-scanner is a tool which generates C headers and rigging for Wayland
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index db0babc..c201b84 100644
|
index 9009517..c6b9ae0 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -6,10 +6,11 @@
|
@@ -6,11 +6,11 @@
|
||||||
/* appearance */
|
/* appearance */
|
||||||
static const int sloppyfocus = 1; /* focus follows mouse */
|
static const int sloppyfocus = 1; /* focus follows mouse */
|
||||||
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
|
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
|
||||||
-static const unsigned int borderpx = 1; /* border pixel of windows */
|
-static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
|
-static const float rootcolor[] = COLOR(0x222222ff);
|
||||||
-static const float bordercolor[] = COLOR(0x444444ff);
|
-static const float bordercolor[] = COLOR(0x444444ff);
|
||||||
-static const float focuscolor[] = COLOR(0x005577ff);
|
-static const float focuscolor[] = COLOR(0x005577ff);
|
||||||
-static const float urgentcolor[] = COLOR(0xff0000ff);
|
-static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
+static unsigned int borderpx = 1; /* border pixel of windows */
|
+static unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
|
+static float rootcolor[] = COLOR(0x222222ff);
|
||||||
+static float bordercolor[] = COLOR(0x444444ff);
|
+static float bordercolor[] = COLOR(0x444444ff);
|
||||||
+static float focuscolor[] = COLOR(0x005577ff);
|
+static float focuscolor[] = COLOR(0x005577ff);
|
||||||
+static float urgentcolor[] = COLOR(0xff0000ff);
|
+static float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
+static float rootcolor[] = COLOR(0x111122ff);
|
|
||||||
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
|
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
|
||||||
static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can also use glsl colors */
|
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
||||||
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index bbb27e4..1f8d5fb 100644
|
index fa76db2..6dd4524 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -396,6 +396,8 @@ static xcb_atom_t netatom[NetLast];
|
@@ -407,6 +407,8 @@ static xcb_atom_t netatom[NetLast];
|
||||||
/* attempt to encapsulate suck into one file */
|
/* attempt to encapsulate suck into one file */
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
|
|
||||||
@ -56,16 +57,16 @@ index bbb27e4..1f8d5fb 100644
|
|||||||
/* function implementations */
|
/* function implementations */
|
||||||
void
|
void
|
||||||
applybounds(Client *c, struct wlr_box *bbox)
|
applybounds(Client *c, struct wlr_box *bbox)
|
||||||
@@ -1017,6 +1019,8 @@ createpointer(struct wlr_pointer *pointer)
|
@@ -1010,6 +1012,8 @@ createpointer(struct wlr_pointer *pointer)
|
||||||
libinput_device_config_accel_set_profile(libinput_device, accel_profile);
|
libinput_device_config_accel_set_profile(device, accel_profile);
|
||||||
libinput_device_config_accel_set_speed(libinput_device, accel_speed);
|
libinput_device_config_accel_set_speed(device, accel_speed);
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ inputconfig(libinput_device);
|
+ inputconfig(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
wlr_cursor_attach_input_device(cursor, &pointer->base);
|
wlr_cursor_attach_input_device(cursor, &pointer->base);
|
||||||
@@ -2886,6 +2890,7 @@ main(int argc, char *argv[])
|
@@ -2974,6 +2978,7 @@ main(int argc, char *argv[])
|
||||||
/* Wayland requires XDG_RUNTIME_DIR for creating its communications socket */
|
/* Wayland requires XDG_RUNTIME_DIR for creating its communications socket */
|
||||||
if (!getenv("XDG_RUNTIME_DIR"))
|
if (!getenv("XDG_RUNTIME_DIR"))
|
||||||
die("XDG_RUNTIME_DIR must be set");
|
die("XDG_RUNTIME_DIR must be set");
|
||||||
@ -296,3 +297,6 @@ index 0000000..618f81e
|
|||||||
+ if (val && sscanf(val, "%u", &tmp) == 1)
|
+ if (val && sscanf(val, "%u", &tmp) == 1)
|
||||||
+ borderpx = tmp;
|
+ borderpx = tmp;
|
||||||
+}
|
+}
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
From 5fbb468e37b9a1e25e0e32462a2ca58758c3f824 Mon Sep 17 00:00:00 2001
|
From 830f6ed5352d32a66c62f49b28439b2bcd904417 Mon Sep 17 00:00:00 2001
|
||||||
From: Dima Krasner <dima@dimakrasner.com>
|
From: Dima Krasner <dima@dimakrasner.com>
|
||||||
Date: Sat, 2 Dec 2023 10:36:35 +0200
|
Date: Sat, 2 Dec 2023 10:36:35 +0200
|
||||||
Subject: [PATCH] fall back to a lower output mode if needed
|
Subject: [PATCH] fall back to a lower output mode if needed
|
||||||
@ -9,10 +9,10 @@ Subject: [PATCH] fall back to a lower output mode if needed
|
|||||||
1 file changed, 12 insertions(+), 1 deletion(-)
|
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index bbb27e4..ea2a3cb 100644
|
index fa76db2..88cabeb 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -856,6 +856,7 @@ createmon(struct wl_listener *listener, void *data)
|
@@ -848,6 +848,7 @@ createmon(struct wl_listener *listener, void *data)
|
||||||
/* This event is raised by the backend when a new output (aka a display or
|
/* This event is raised by the backend when a new output (aka a display or
|
||||||
* monitor) becomes available. */
|
* monitor) becomes available. */
|
||||||
struct wlr_output *wlr_output = data;
|
struct wlr_output *wlr_output = data;
|
||||||
@ -20,7 +20,7 @@ index bbb27e4..ea2a3cb 100644
|
|||||||
const MonitorRule *r;
|
const MonitorRule *r;
|
||||||
size_t i;
|
size_t i;
|
||||||
struct wlr_output_state state;
|
struct wlr_output_state state;
|
||||||
@@ -890,7 +891,17 @@ createmon(struct wl_listener *listener, void *data)
|
@@ -884,7 +885,17 @@ createmon(struct wl_listener *listener, void *data)
|
||||||
* monitor supports only a specific set of modes. We just pick the
|
* monitor supports only a specific set of modes. We just pick the
|
||||||
* monitor's preferred mode; a more sophisticated compositor would let
|
* monitor's preferred mode; a more sophisticated compositor would let
|
||||||
* the user configure it. */
|
* the user configure it. */
|
||||||
@ -39,3 +39,6 @@ index bbb27e4..ea2a3cb 100644
|
|||||||
|
|
||||||
/* Set up event listeners */
|
/* Set up event listeners */
|
||||||
LISTEN(&wlr_output->events.frame, &m->frame, rendermon);
|
LISTEN(&wlr_output->events.frame, &m->frame, rendermon);
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
From ae70de3793109624ae7f8cdfebd214ef3e883f79 Mon Sep 17 00:00:00 2001
|
From 65e3f3eb1eea35601949499c0cd2c2032773b732 Mon Sep 17 00:00:00 2001
|
||||||
From: Dima Krasner <dima@dimakrasner.com>
|
From: Dima Krasner <dima@dimakrasner.com>
|
||||||
Date: Thu, 21 Jul 2022 21:14:14 +0300
|
Date: Thu, 21 Jul 2022 21:14:14 +0300
|
||||||
Subject: [PATCH] extend the display to the right
|
Subject: [PATCH] extend the display to the right
|
||||||
@ -8,10 +8,10 @@ Subject: [PATCH] extend the display to the right
|
|||||||
1 file changed, 11 insertions(+), 2 deletions(-)
|
1 file changed, 11 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index bbb27e4..2ae003e 100644
|
index fa76db2..0fe3e97 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -859,7 +859,8 @@ createmon(struct wl_listener *listener, void *data)
|
@@ -851,7 +851,8 @@ createmon(struct wl_listener *listener, void *data)
|
||||||
const MonitorRule *r;
|
const MonitorRule *r;
|
||||||
size_t i;
|
size_t i;
|
||||||
struct wlr_output_state state;
|
struct wlr_output_state state;
|
||||||
@ -21,7 +21,7 @@ index bbb27e4..2ae003e 100644
|
|||||||
|
|
||||||
if (!wlr_output_init_render(wlr_output, alloc, drw))
|
if (!wlr_output_init_render(wlr_output, alloc, drw))
|
||||||
return;
|
return;
|
||||||
@@ -901,6 +902,14 @@ createmon(struct wl_listener *listener, void *data)
|
@@ -895,6 +896,14 @@ createmon(struct wl_listener *listener, void *data)
|
||||||
wlr_output_commit_state(wlr_output, &state);
|
wlr_output_commit_state(wlr_output, &state);
|
||||||
wlr_output_state_finish(&state);
|
wlr_output_state_finish(&state);
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ index bbb27e4..2ae003e 100644
|
|||||||
wl_list_insert(&mons, &m->link);
|
wl_list_insert(&mons, &m->link);
|
||||||
printstatus();
|
printstatus();
|
||||||
|
|
||||||
@@ -924,7 +933,7 @@ createmon(struct wl_listener *listener, void *data)
|
@@ -918,7 +927,7 @@ createmon(struct wl_listener *listener, void *data)
|
||||||
*/
|
*/
|
||||||
m->scene_output = wlr_scene_output_create(scene, wlr_output);
|
m->scene_output = wlr_scene_output_create(scene, wlr_output);
|
||||||
if (m->m.x < 0 || m->m.y < 0)
|
if (m->m.x < 0 || m->m.y < 0)
|
||||||
@ -44,4 +44,7 @@ index bbb27e4..2ae003e 100644
|
|||||||
+ wlr_output_layout_add(output_layout, wlr_output, max_x, max_x_y);
|
+ wlr_output_layout_add(output_layout, wlr_output, max_x, max_x_y);
|
||||||
else
|
else
|
||||||
wlr_output_layout_add(output_layout, wlr_output, m->m.x, m->m.y);
|
wlr_output_layout_add(output_layout, wlr_output, m->m.x, m->m.y);
|
||||||
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
|
}
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
From ad717ddd80ec86b2c1f87b88c673bd272332790a Mon Sep 17 00:00:00 2001
|
From f74add348119aa8e953e2f49bf5588d29c1151e3 Mon Sep 17 00:00:00 2001
|
||||||
From: Dima Krasner <dima@dimakrasner.com>
|
From: Dima Krasner <dima@dimakrasner.com>
|
||||||
Date: Sat, 15 Jul 2023 15:45:58 +0300
|
Date: Sun, 11 Feb 2024 09:09:16 +0200
|
||||||
Subject: [PATCH] add the snail layout
|
Subject: [PATCH] add the snail layout
|
||||||
MIME-Version: 1.0
|
MIME-Version: 1.0
|
||||||
Content-Type: text/plain; charset=UTF-8
|
Content-Type: text/plain; charset=UTF-8
|
||||||
@ -93,14 +93,14 @@ With 2 windows in the master area, many windows in the stack and low mfact:
|
|||||||
└──────────┴──────────┴─────┴────┘
|
└──────────┴──────────┴─────┴────┘
|
||||||
---
|
---
|
||||||
config.def.h | 4 +-
|
config.def.h | 4 +-
|
||||||
dwl.c | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
dwl.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
2 files changed, 104 insertions(+), 1 deletion(-)
|
2 files changed, 105 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index db0babc..fae7887 100644
|
index 9009517..1969030 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -33,6 +33,7 @@ static const Layout layouts[] = {
|
@@ -34,6 +34,7 @@ static const Layout layouts[] = {
|
||||||
{ "[]=", tile },
|
{ "[]=", tile },
|
||||||
{ "><>", NULL }, /* no layout function means floating behavior */
|
{ "><>", NULL }, /* no layout function means floating behavior */
|
||||||
{ "[M]", monocle },
|
{ "[M]", monocle },
|
||||||
@ -108,16 +108,16 @@ index db0babc..fae7887 100644
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* monitors */
|
/* monitors */
|
||||||
@@ -42,7 +43,7 @@ static const MonitorRule monrules[] = {
|
@@ -44,7 +45,7 @@ static const MonitorRule monrules[] = {
|
||||||
{ "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
{ "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
||||||
*/
|
*/
|
||||||
/* defaults */
|
/* defaults */
|
||||||
- { NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
- { NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
||||||
+ { NULL, 0.64, 1, 1, &layouts[3], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
+ { NULL, 0.64f, 1, 1, &layouts[3], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* keyboard */
|
/* keyboard */
|
||||||
@@ -132,6 +133,7 @@ static const Key keys[] = {
|
@@ -134,6 +135,7 @@ static const Key keys[] = {
|
||||||
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
|
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
|
||||||
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
|
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
|
||||||
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
|
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
|
||||||
@ -126,10 +126,10 @@ index db0babc..fae7887 100644
|
|||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
|
||||||
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
|
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index 6a96179..25e0137 100644
|
index fa76db2..ca7830d 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -306,6 +306,7 @@ static void setmon(Client *c, Monitor *m, uint32_t newtags);
|
@@ -312,6 +312,7 @@ static void setmon(Client *c, Monitor *m, uint32_t newtags);
|
||||||
static void setpsel(struct wl_listener *listener, void *data);
|
static void setpsel(struct wl_listener *listener, void *data);
|
||||||
static void setsel(struct wl_listener *listener, void *data);
|
static void setsel(struct wl_listener *listener, void *data);
|
||||||
static void setup(void);
|
static void setup(void);
|
||||||
@ -137,14 +137,15 @@ index 6a96179..25e0137 100644
|
|||||||
static void spawn(const Arg *arg);
|
static void spawn(const Arg *arg);
|
||||||
static void startdrag(struct wl_listener *listener, void *data);
|
static void startdrag(struct wl_listener *listener, void *data);
|
||||||
static void tag(const Arg *arg);
|
static void tag(const Arg *arg);
|
||||||
@@ -2361,6 +2362,106 @@ setup(void)
|
@@ -2420,6 +2421,107 @@ setup(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
+void
|
+void
|
||||||
+snail(Monitor *m)
|
+snail(Monitor *m)
|
||||||
+{
|
+{
|
||||||
+ unsigned int i = 0, n = 0, mw = m->w.width;
|
+ int i = 0, n = 0;
|
||||||
|
+ unsigned int mw = m->w.width;
|
||||||
+ Client *c, *prev;
|
+ Client *c, *prev;
|
||||||
+ enum wlr_direction dir = WLR_DIRECTION_RIGHT;
|
+ enum wlr_direction dir = WLR_DIRECTION_RIGHT;
|
||||||
+
|
+
|
||||||
@ -155,7 +156,7 @@ index 6a96179..25e0137 100644
|
|||||||
+ return;
|
+ return;
|
||||||
+
|
+
|
||||||
+ if (n > m->nmaster)
|
+ if (n > m->nmaster)
|
||||||
+ mw = m->nmaster ? m->w.width * m->mfact : 0;
|
+ mw = m->nmaster ? ROUND(m->w.width * m->mfact) : 0;
|
||||||
+
|
+
|
||||||
+ wl_list_for_each(c, &clients, link) {
|
+ wl_list_for_each(c, &clients, link) {
|
||||||
+ if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
|
+ if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
|
||||||
@ -244,3 +245,6 @@ index 6a96179..25e0137 100644
|
|||||||
void
|
void
|
||||||
spawn(const Arg *arg)
|
spawn(const Arg *arg)
|
||||||
{
|
{
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user