Merge branch 'main' into killunsel

This commit is contained in:
oli4warin 2025-09-25 14:47:26 +02:00
commit 1742d5febc
12 changed files with 2931 additions and 7 deletions

View File

@ -37,8 +37,9 @@ If you target the unstable `main` branch, specify that in the `Download` link on
^^^ "0.7" is an example. Use the release that your patch targets
- [main YYYY-MM-DD](/dwl/dwl-patches/raw/branch/main/patches/PATCHNAME/PATCHNAME.patch)
^^^^^^^^^^ Patches targeting the unstable "main" branch include a YYYY-MM-DD indicator
### Authors - latest at top [Codeberg nick is mandatory; other contact methods optional]
### Authors - latest at top
- [YOUR_NICK](https://codeberg.org/USERNAME)
^^^^^^^^^ Codeberg nick is mandatory; other contact methods optional
your_email@if_you_wish_to.share.it
your_irc_nick at [Libera IRC dwl channel](https://web.libera.chat/?channels=#dwl)
your_discord_handle at [dwl Discord](https://discord.gg/jJxZnrGPWN)

View File

@ -13,6 +13,7 @@ slstatus -s | dwl
* pixman
### Download
- [main 2025-07-29](/dwl/dwl-patches/raw/branch/main/patches/bar/bar.patch)
- [0.7](/dwl/dwl-patches/raw/branch/main/patches/bar/bar-0.7.patch)
- [0.6](/dwl/dwl-patches/raw/branch/main/patches/bar/bar-0.6.patch)

1266
patches/bar/bar.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
From f109808140cd6323b3a100663a10e048ae32e3a0 Mon Sep 17 00:00:00 2001
From 5fab55803d009d400f6c3fcbe6a0fc807431bbe7 Mon Sep 17 00:00:00 2001
From: mmistika <mistikasoft@gmail.com>
Date: Thu, 17 Jul 2025 11:59:18 +0200
Subject: [PATCH] Add configurable window resize
@ -6,8 +6,8 @@ Subject: [PATCH] Add configurable window resize
Signed-off-by: mmistika <mistikasoft@gmail.com>
---
config.def.h | 12 ++++++++++++
dwl.c | 45 +++++++++++++++++++++++++++++++++++++--------
2 files changed, 49 insertions(+), 8 deletions(-)
dwl.c | 48 ++++++++++++++++++++++++++++++++++++++++--------
2 files changed, 52 insertions(+), 8 deletions(-)
diff --git a/config.def.h b/config.def.h
index 22d2171..e404549 100644
@ -33,7 +33,7 @@ index 22d2171..e404549 100644
static const Rule rules[] = {
/* app_id title tags mask isfloating monitor */
diff --git a/dwl.c b/dwl.c
index c717c1d..aacd074 100644
index c717c1d..0d56b49 100644
--- a/dwl.c
+++ b/dwl.c
@@ -407,6 +407,7 @@ static KeyboardGroup *kb_group;
@ -44,7 +44,7 @@ index c717c1d..aacd074 100644
static struct wlr_output_layout *output_layout;
static struct wlr_box sgeom;
@@ -1873,8 +1874,24 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d
@@ -1873,8 +1874,27 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d
.width = grabc->geom.width, .height = grabc->geom.height}, 1);
return;
} else if (cursor_mode == CurResize) {
@ -53,6 +53,9 @@ index c717c1d..aacd074 100644
+ int cdx = (int)round(cursor->x) - grabcx;
+ int cdy = (int)round(cursor->y) - grabcy;
+
+ cdx = !(rzcorner & 1) && grabc->geom.width - 2 * (int)grabc->bw - cdx < 1 ? 0 : cdx;
+ cdy = !(rzcorner & 2) && grabc->geom.height - 2 * (int)grabc->bw - cdy < 1 ? 0 : cdy;
+
+ const struct wlr_box box = {
+ .x = grabc->geom.x + (rzcorner & 1 ? 0 : cdx),
+ .y = grabc->geom.y + (rzcorner & 2 ? 0 : cdy),
@ -71,7 +74,7 @@ index c717c1d..aacd074 100644
return;
}
@@ -1920,12 +1937,24 @@ moveresize(const Arg *arg)
@@ -1920,12 +1940,24 @@ moveresize(const Arg *arg)
wlr_cursor_set_xcursor(cursor, cursor_mgr, "fleur");
break;
case CurResize:

View File

@ -0,0 +1,11 @@
### Description
This patch changes the default behavior of the [disable-keybindings-on-fullscreen](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/disable-keybindings-on-fullscreen) patch by only taking effect when you explicitly toggle the functionality.
You must apply that patch prior to applying this one.
### Download
- [git branch](https://github.com/Shringe/dwl/tree/disable-keybindings-on-fullscreen-toggle)
- [0.7](/dwl/dwl-patches/raw/branch/main/patches/disable-keybindings-on-fullscreen-toggle/disable-keybindings-on-fullscreen-toggle-0.7.patch)
### Authors
- [Shringe](https://codeberg.org/Shringe)
- shringe_ at [dwl Discord](https://discord.gg/jJxZnrGPWN)

View File

@ -0,0 +1,71 @@
From 71809cee0e27f1b3620773e1745afed8023f71c9 Mon Sep 17 00:00:00 2001
From: Shringe <dashingkoso@gmail.com>
Date: Mon, 23 Jun 2025 18:50:40 -0500
Subject: [PATCH] Implemented functionality for patch
---
config.def.h | 1 +
dwl.c | 14 ++++++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/config.def.h b/config.def.h
index 22d2171..dda4ad0 100644
--- a/config.def.h
+++ b/config.def.h
@@ -142,6 +142,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_space, setlayout, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_G, togglefullscreenkeyinhibit, {0} },
{ MODKEY, XKB_KEY_0, view, {.ui = ~0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
diff --git a/dwl.c b/dwl.c
index f11de4b..5deb9c7 100644
--- a/dwl.c
+++ b/dwl.c
@@ -341,6 +341,7 @@ static void tagmon(const Arg *arg);
static void tile(Monitor *m);
static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
+static void togglefullscreenkeyinhibit(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
static void unlocksession(struct wl_listener *listener, void *data);
@@ -414,6 +415,8 @@ static struct wlr_box sgeom;
static struct wl_list mons;
static Monitor *selmon;
+static int fullscreen_key_inhibit_enabled = 0;
+
#ifdef XWAYLAND
static void activatex11(struct wl_listener *listener, void *data);
static void associatex11(struct wl_listener *listener, void *data);
@@ -1583,8 +1586,9 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
for (k = keys; k < END(keys); k++) {
if (CLEANMASK(mods) == CLEANMASK(k->mod)
&& sym == k->keysym && k->func) {
- if (c && c->isfullscreen) {
- if (k->func == togglefullscreen) {
+ if (fullscreen_key_inhibit_enabled
+ && c && c->isfullscreen) {
+ if (k->func == togglefullscreenkeyinhibit) {
k->func(&k->arg);
return 1;
}
@@ -2763,6 +2767,12 @@ togglefullscreen(const Arg *arg)
setfullscreen(sel, !sel->isfullscreen);
}
+void
+togglefullscreenkeyinhibit(const Arg *arg)
+{
+ fullscreen_key_inhibit_enabled = !fullscreen_key_inhibit_enabled;
+}
+
void
toggletag(const Arg *arg)
{
--
2.49.0

View File

@ -0,0 +1,54 @@
### Description
This patch adds river-control-unstable-v1 support to dwl.
This protocol allows sending args to dwl to execute functions via the included dwlctl.
This is used to allow changing rules and binds, at runtime via dwlctl.
Most of this patch is stored in river-control.h, It contains a list of functions which can be called via dwlctl so adding support for new functions is as simple as adding them to the list.
This patch's main intended use case is to have a startup script that calls dwlctl a bunch to add all the binds/rules you want, without the need of restarting dwl if you make any changes to the list of binds/rules.
This patch also adds keybind modes which allow switching between a diffrent sets of keybinds on the fly.
Also you can set a keybind mode as oneshot (meaning as soon as a keybind is activated the mode is switched) by using...
`dwlctl oneshot-mode _layout_you_want_to_make_oneshot_here_ _layout_you_want_to_switch_to_after_keybind_pressed_`
Just make sure to set a mode as oneshot after creating a bind under it otherwise it won't work.
### dwlctl syntax example
```
dwlctl clear-binds
dwlctl bind normal super,shift Return spawn kitty tmux
dwlctl bind normal supershift q killclient
dwlctl bind normal super l enter-mode layoutpick
dwlctl bind layoutpick none t layout 0
dwlctl bind layoutpick none f layout 1
dwlctl bind layoutpick none m layout 2
dwlctl oneshot-mode layoutpick normal
dwlctl clear-rules
dwlctl rule-add -appid steam -title steam float tags $((1 << 2))
dwlctl rule-add -appid kitty float
dwlctl rule-add -title firefox float
dwlctl spawn kitty tmux
dwlctl setlayout 2
dwlctl togglefullscreen
```
### Download
- [git branch](/zuki/dwl-ctl/src/main)
- [0.7](/dwl/dwl-patches/raw/branch/main/patches/riverctl/riverctl.patch)
- [main 2025-07-29](/dwl/dwl-patches/raw/branch/main/patches/riverctl/riverctl.patch)
### Authors - latest at top
- [zuki](https://codeberg.org/zuki)
zukirust@gmail.com
zuki at [Libera IRC dwl channel](https://web.libera.chat/?channels=#dwl)
#zukigay at [dwl Discord](https://discord.gg/jJxZnrGPWN)

File diff suppressed because it is too large Load Diff

42
patches/stairs/README.md Normal file
View File

@ -0,0 +1,42 @@
### Description
Port of the [stairs](https://dwm.suckless.org/patches/stairs/) patch from dwm.
The remaining text is from the description on the dwm site:
This layout can be modified using the 3 variables provided in config.h: stairpx, stairdirection and stairsamesize.
```
+-------------+--------+----------------+
| | | |
| | +--| S1 |
| | |S2| |
| | +--| | |
| | |S3| | |
| M |--| | +----------------+
| |S4| | | |
| | | +-----------------+ |
| | | | |
| | +------------------+ |
| | | |
+-------------+-------------------+-----+
stairsamesize = 1
+-------------+--------+----------------+
| | | |
| | +--| S1 |
| | |S2| |
| | +--| | |
| | |S3| | |
| M |--| | | |
| |S4| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
+-------------+--+--+--+----------------+
stairsamesize = 0
```
### Download
- [0.7](/dwl/dwl-patches/raw/branch/main/patches/stairs/stairs.patch)
### Authors
- [MayOrMayNotBeACat](https://codeberg.org/MayOrMayNotBeACat)

136
patches/stairs/stairs.patch Normal file
View File

@ -0,0 +1,136 @@
From d5bbe6d54d044fa11c76e2e20b96a44897319424 Mon Sep 17 00:00:00 2001
From: Nikita Ivanov <nikita.vyach.ivanov@gmail.com>
Date: Tue, 4 Feb 2025 20:51:06 +0100
Subject: [PATCH 1/2] Fix crash disabling monitor with locked surface
(cherry picked from commit d1880b44223701c91b51b319fc69a0f63044f861)
---
dwl.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dwl.c b/dwl.c
index cf3ef70..c717c1d 100644
--- a/dwl.c
+++ b/dwl.c
@@ -716,6 +716,8 @@ cleanupmon(struct wl_listener *listener, void *data)
wl_list_remove(&m->frame.link);
wl_list_remove(&m->link);
wl_list_remove(&m->request_state.link);
+ if (m->lock_surface)
+ destroylocksurface(&m->destroy_lock_surface, NULL);
m->wlr_output->data = NULL;
wlr_output_layout_remove(output_layout, m->wlr_output);
wlr_scene_output_destroy(m->scene_output);
--
2.50.1
From b6e96ab6281eddacdda26c39e6446b72ce05de39 Mon Sep 17 00:00:00 2001
From: JustinWayland <justintwayland+github@gmail.com>
Date: Fri, 6 Jun 2025 22:14:31 -0400
Subject: [PATCH 2/2] Add stairs layout.
---
config.def.h | 5 +++++
dwl.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 53 insertions(+)
diff --git a/config.def.h b/config.def.h
index 22d2171..e81568c 100644
--- a/config.def.h
+++ b/config.def.h
@@ -7,6 +7,9 @@
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 unsigned int borderpx = 1; /* border pixel of windows */
+static const unsigned int stairpx = 20; /* depth of the stairs layout */
+static const int stairdirection = 1; /* 0: left-aligned, 1: right-aligned */
+static const int stairsamesize = 1; /* 1 means shrink all the staired windows to the same size */
static const float rootcolor[] = COLOR(0x222222ff);
static const float bordercolor[] = COLOR(0x444444ff);
static const float focuscolor[] = COLOR(0x005577ff);
@@ -34,6 +37,7 @@ static const Layout layouts[] = {
{ "[]=", tile },
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
+ { "[S]", stairs },
};
/* monitors */
@@ -139,6 +143,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
+ { MODKEY, XKB_KEY_s, setlayout, {.v = &layouts[3]} },
{ MODKEY, XKB_KEY_space, setlayout, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
diff --git a/dwl.c b/dwl.c
index cf3ef70..4debf15 100644
--- a/dwl.c
+++ b/dwl.c
@@ -334,6 +334,7 @@ static void setpsel(struct wl_listener *listener, void *data);
static void setsel(struct wl_listener *listener, void *data);
static void setup(void);
static void spawn(const Arg *arg);
+static void stairs(Monitor* m);
static void startdrag(struct wl_listener *listener, void *data);
static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
@@ -2657,6 +2658,53 @@ spawn(const Arg *arg)
}
}
+void
+stairs(Monitor *m)
+{
+ int i, n, h, mw, my;
+ int ox, oy, ow, oh;
+ Client *c;
+
+ n = 0;
+ wl_list_for_each(c, &clients, link)
+ if (VISIBLEON(c, m) && !c->isfloating && !c->isfullscreen)
+ n++;
+ if (n == 0)
+ return;
+
+ if (n > m->nmaster)
+ mw = m->nmaster ? ROUND(m->w.width * m->mfact) : 0;
+ else
+ mw = m->w.width;
+
+ i = my = 0;
+ wl_list_for_each(c, &clients, link) {
+ if (!VISIBLEON(c,m) || c->isfloating || c->fullscreen)
+ continue;
+ if (i < m->nmaster) {
+ h = (m->w.height - my) / (MIN(n, m->nmaster) - i);
+ resize(c, (struct wlr_box){
+ .x=m->w.x,.y=m->w.y + my,.width=mw,.height=h
+ }, 0);
+ my += c->geom.height;
+ } else {
+ oy = i - m->nmaster;
+ ox = stairdirection ? n - i - 1 : (stairsamesize ? i - m->nmaster: 0);
+ ow = stairsamesize ? n - m->nmaster - 1 : n - i - 1;
+ oh = stairsamesize ? ow : i - m->nmaster;
+ resize(c, (struct wlr_box){
+ .x=m->w.x + mw + (ox * stairpx),
+ .y=m->w.y + (oy * stairpx),
+ .width=m->w.width - mw - (ow * stairpx),
+ .height=m->w.height - (oh * stairpx)
+ }, 0);
+ if (c == focustop(selmon))
+ wlr_scene_node_raise_to_top(&c->scene->node);
+ }
+ i++;
+ }
+}
+
void
startdrag(struct wl_listener *listener, void *data)
{
--
2.50.1

33
patches/systemd/README.md Normal file
View File

@ -0,0 +1,33 @@
### Description
This is a simple patch that runs `systemctl --user import-environment WAYLAND_DISPLAY DISPLAY`, and `systemctl --user start dwl-session.target` after Dwl initializes, and then `systemctl --user stop dwl-session.target` when Dwl quits. This allows you to handle graceful startup and shutdown of your graphical systemd services, with the proper environment variables set. This is similar to [uwsm](https://github.com/Vladimir-csp/uwsm?tab=readme-ov-file), but it integrates natively with your existing systemd user services, and doesn't have uwsm's runtime overhead.
You must have a `dwl-session.target` created that binds to `graphical-session.target`. You can then set the WantedBy of your systemd services to either `graphical-session.target`, or `dwl-session.target`, depending on whether you want them to start for just Dwl, or for every graphical session.
Below is the Nix home-manager configuration I use to generate `dwl-session.target`, and its resulting output.
```
systemd.user.targets.dwl-session.Unit = {
Description = "dwl compositor session";
Documentation = [ "man:systemd.special(7)" ];
BindsTo = [ "graphical-session.target" ];
Wants = [ "graphical-session-pre.target" ];
After = [ "graphical-session-pre.target" ];
};
```
```
[Unit]
After=graphical-session-pre.target
BindsTo=graphical-session.target
Description=dwl compositor session
Documentation=man:systemd.special(7)
Wants=graphical-session-pre.target
```
### Download
- [git branch](https://github.com/Shringe/dwl/tree/systemd)
- [0.7](/dwl/dwl-patches/raw/branch/main/patches/systemd/systemd-0.7.patch)
### Authors
- [Shringe](https://codeberg.org/Shringe)
- shringe_ at [dwl Discord](https://discord.gg/jJxZnrGPWN)

View File

@ -0,0 +1,64 @@
From 43b3026b0744d54287eada71c84ea8be174950c3 Mon Sep 17 00:00:00 2001
From: Shringe <dashingkoso@gmail.com>
Date: Sat, 12 Jul 2025 01:00:46 -0500
Subject: [PATCH] basic implementation
---
dwl.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/dwl.c b/dwl.c
index c717c1d..4ba134d 100644
--- a/dwl.c
+++ b/dwl.c
@@ -680,6 +680,15 @@ cleanup(void)
wlr_xwayland_destroy(xwayland);
xwayland = NULL;
#endif
+ /* Stop systemd target */
+ if (fork() == 0) {
+ setsid();
+ execvp("systemctl", (char *const[]) {
+ "systemctl", "--user", "stop", "dwl-session.target", NULL
+ });
+ exit(1);
+ }
+
wl_display_destroy_clients(dpy);
if (child_pid > 0) {
kill(-child_pid, SIGTERM);
@@ -2222,6 +2231,31 @@ run(char *startup_cmd)
die("startup: display_add_socket_auto");
setenv("WAYLAND_DISPLAY", socket, 1);
+ /* Import environment variables then start systemd target */
+ if (fork() == 0) {
+ setsid();
+
+ /* First: import environment variables */
+ pid_t import_pid = fork();
+ if (import_pid == 0) {
+ execvp("systemctl", (char *const[]) {
+ "systemctl", "--user", "import-environment",
+ "DISPLAY", "WAYLAND_DISPLAY", NULL
+ });
+ exit(1);
+ }
+
+ /* Wait for import to complete */
+ waitpid(import_pid, NULL, 0);
+
+ /* Second: start target */
+ execvp("systemctl", (char *const[]) {
+ "systemctl", "--user", "start", "dwl-session.target", NULL
+ });
+
+ exit(1);
+ }
+
/* Start the backend. This will enumerate outputs and inputs, become the DRM
* master, etc */
if (!wlr_backend_start(backend))
--
2.49.0