From 59212b702cda33575bd5177f2352347bc12121fb Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Mon, 9 Feb 2026 10:30:29 +0100 Subject: [PATCH] update center-terminal, shiftview, switchtotag --- patches/center-terminal/README.md | 2 +- patches/center-terminal/center-terminal.patch | 30 +++++++------- patches/shiftview/README.md | 2 +- patches/shiftview/shiftview.patch | 28 ++++++------- patches/switchtotag/README.md | 2 +- patches/switchtotag/switchtotag.patch | 41 +++++++++---------- 6 files changed, 52 insertions(+), 53 deletions(-) diff --git a/patches/center-terminal/README.md b/patches/center-terminal/README.md index cfd70a2..41e2527 100644 --- a/patches/center-terminal/README.md +++ b/patches/center-terminal/README.md @@ -7,7 +7,7 @@ covering the wallpaper more than necessary. ### Download - [git branch](https://codeberg.org/guidocella/dwl/src/branch/center-terminal) -- [2024-02-06](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/center-terminal/center-terminal.patch) +- [2026-02-09](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/center-terminal/center-terminal.patch) ### Authors - [Guido Cella](https://codeberg.org/guidocella) diff --git a/patches/center-terminal/center-terminal.patch b/patches/center-terminal/center-terminal.patch index 214eaf2..796d78d 100644 --- a/patches/center-terminal/center-terminal.patch +++ b/patches/center-terminal/center-terminal.patch @@ -1,6 +1,6 @@ -From 340cc5ef90dfcc495bdad045f3f76ae07405cffd Mon Sep 17 00:00:00 2001 +From 897765216ac8567a40654b813379a4e074ca6298 Mon Sep 17 00:00:00 2001 From: Guido Cella -Date: Tue, 6 Feb 2024 09:20:48 +0100 +Date: Mon, 9 Feb 2026 10:21:33 +0100 Subject: [PATCH] add a keybinding to center the terminal Add a keybinding that toggles centering the terminally horizontally when @@ -14,19 +14,19 @@ covering the wallpaper more than necessary. 2 files changed, 21 insertions(+) diff --git a/config.def.h b/config.def.h -index 22d2171..8229fcc 100644 +index 8a6eda0..8c35c40 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, XKB_KEY_v, togglecenter, {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} }, +@@ -138,6 +138,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, XKB_KEY_v, togglecenter, {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 12f441e..3b15748 100644 +index 44f3ad9..9ee397a 100644 --- a/dwl.c +++ b/dwl.c @@ -8,6 +8,7 @@ @@ -72,7 +72,7 @@ index 12f441e..3b15748 100644 c->isfloating |= client_is_float_type(c); setmon(c, mon, newtags); } -@@ -2730,6 +2738,11 @@ tile(Monitor *m) +@@ -2731,6 +2739,11 @@ tile(Monitor *m) if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen) continue; if (i < m->nmaster) { @@ -84,7 +84,7 @@ index 12f441e..3b15748 100644 resize(c, (struct wlr_box){.x = m->w.x, .y = m->w.y + my, .width = mw, .height = (m->w.height - my) / (MIN(n, m->nmaster) - i)}, 0); my += c->geom.height; -@@ -2742,6 +2755,13 @@ tile(Monitor *m) +@@ -2743,6 +2756,13 @@ tile(Monitor *m) } } @@ -99,5 +99,5 @@ index 12f441e..3b15748 100644 togglefloating(const Arg *arg) { -- -2.49.0 +2.52.0 diff --git a/patches/shiftview/README.md b/patches/shiftview/README.md index 2d25820..8e26f4d 100644 --- a/patches/shiftview/README.md +++ b/patches/shiftview/README.md @@ -3,7 +3,7 @@ Add keybindings to cycle through tags with visible clients. ### Download - [git branch](https://codeberg.org/guidocella/dwl/src/branch/shiftview) -- [2024-01-27](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/shiftview/shiftview.patch) +- [2026-02-09](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/shiftview/shiftview.patch) ### Authors - [Guido Cella](https://codeberg.org/guidocella) diff --git a/patches/shiftview/shiftview.patch b/patches/shiftview/shiftview.patch index f556916..50a849b 100644 --- a/patches/shiftview/shiftview.patch +++ b/patches/shiftview/shiftview.patch @@ -1,4 +1,4 @@ -From 40f9140742277d0298988990264f4b6a738f8122 Mon Sep 17 00:00:00 2001 +From ce4217d8ee9c28ba76ca34fae7a7c3ef1aceecb0 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Sat, 27 Jan 2024 22:43:29 +0100 Subject: [PATCH] cycle through tags @@ -10,27 +10,27 @@ Subject: [PATCH] cycle through tags create mode 100644 shiftview.c diff --git a/config.def.h b/config.def.h -index 9009517..8d77ec0 100644 +index 8a6eda0..fd80703 100644 --- a/config.def.h +++ b/config.def.h -@@ -117,6 +117,8 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA +@@ -118,6 +118,8 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA static const char *termcmd[] = { "foot", NULL }; - static const char *menucmd[] = { "bemenu-run", NULL }; + static const char *menucmd[] = { "wmenu-run", NULL }; +#include "shiftview.c" + static const Key keys[] = { - /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */ - /* modifier key function argument */ -@@ -130,6 +132,8 @@ static const Key keys[] = { - { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} }, - { MODKEY, XKB_KEY_Return, zoom, {0} }, - { MODKEY, XKB_KEY_Tab, view, {0} }, + /* Note that Shift changes certain key codes: 2 -> at, etc. */ + /* modifier key function argument */ +@@ -131,6 +133,8 @@ static const Key keys[] = { + { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} }, + { MODKEY, XKB_KEY_Return, zoom, {0} }, + { MODKEY, XKB_KEY_Tab, view, {0} }, + { MODKEY, XKB_KEY_a, shiftview, { .i = -1 } }, + { MODKEY, XKB_KEY_semicolon, shiftview, { .i = 1 } }, - { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} }, - { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_c, killclient, {0} }, + { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} }, + { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, diff --git a/shiftview.c b/shiftview.c new file mode 100644 index 0000000..fa53db0 @@ -72,5 +72,5 @@ index 0000000..fa53db0 + } +} -- -2.43.0 +2.52.0 diff --git a/patches/switchtotag/README.md b/patches/switchtotag/README.md index 55175d1..7798695 100644 --- a/patches/switchtotag/README.md +++ b/patches/switchtotag/README.md @@ -3,7 +3,7 @@ Add a rule option to switch to the configured tag when a window opens, then swit ### Download - [git branch](https://codeberg.org/guidocella/dwl/src/branch/switchtotag) -- [2024-09-30](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/switchtotag/switchtotag.patch) +- [2026-02-09](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/switchtotag/switchtotag.patch) ### Authors - [Guido Cella](https://codeberg.org/guidocella) diff --git a/patches/switchtotag/switchtotag.patch b/patches/switchtotag/switchtotag.patch index bbe1638..98349ac 100644 --- a/patches/switchtotag/switchtotag.patch +++ b/patches/switchtotag/switchtotag.patch @@ -1,4 +1,4 @@ -From 08cfc2eceb34316cfd7eaf591a8a631e3d58ff3a Mon Sep 17 00:00:00 2001 +From bfcfb26b00cb93a359469cb8817861439818b430 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Mon, 30 Sep 2024 08:40:25 +0200 Subject: [PATCH] allow switching to the configured tag when a window opens @@ -11,28 +11,27 @@ then switch back when it closes. 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/config.def.h b/config.def.h -index 22d2171..52ea128 100644 +index 8a6eda0..59e3ac5 100644 --- a/config.def.h +++ b/config.def.h -@@ -22,10 +22,10 @@ static int log_level = WLR_ERROR; +@@ -21,9 +21,9 @@ static const float fullscreen_bg[] = {0.0f, 0.0f, 0.0f, 1.0f}; /* You ca + static int log_level = WLR_ERROR; - /* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */ static const Rule rules[] = { - /* app_id title tags mask isfloating monitor */ -+ /* app_id title tags mask switchtotag isfloating monitor */ - /* examples: */ - { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */ - { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */ -+ { "Gimp_EXAMPLE", NULL, 0, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */ -+ { "firefox_EXAMPLE", NULL, 1 << 8, 1, 0, -1 }, /* Start on ONLY tag "9" */ ++ /* app_id title tags mask switchtotag isfloating monitor */ ++ { "Gimp_EXAMPLE", NULL, 0, 0 1, -1 }, /* Start on currently visible tags floating, not tiled */ ++ { "firefox_EXAMPLE", NULL, 1 << 8, 1 0, -1 }, /* Start on ONLY tag "9" */ + /* default/example rule: can be changed but cannot be eliminated; at least one rule must exist */ }; - /* layout(s) */ diff --git a/dwl.c b/dwl.c -index dc0c861..621b614 100644 +index 44f3ad9..7a97d94 100644 --- a/dwl.c +++ b/dwl.c -@@ -142,6 +142,7 @@ typedef struct { +@@ -138,6 +138,7 @@ typedef struct { unsigned int bw; uint32_t tags; int isfloating, isurgent, isfullscreen; @@ -40,7 +39,7 @@ index dc0c861..621b614 100644 uint32_t resize; /* configure serial of a pending resize */ } Client; -@@ -230,6 +231,7 @@ typedef struct { +@@ -226,6 +227,7 @@ typedef struct { const char *id; const char *title; uint32_t tags; @@ -48,7 +47,7 @@ index dc0c861..621b614 100644 int isfloating; int monitor; } Rule; -@@ -245,7 +247,7 @@ typedef struct { +@@ -241,7 +243,7 @@ typedef struct { /* function declarations */ static void applybounds(Client *c, struct wlr_box *bbox); @@ -57,7 +56,7 @@ index dc0c861..621b614 100644 static void arrange(Monitor *m); static void arrangelayer(Monitor *m, struct wl_list *list, struct wlr_box *usable_area, int exclusive); -@@ -449,7 +451,7 @@ applybounds(Client *c, struct wlr_box *bbox) +@@ -474,7 +476,7 @@ applybounds(Client *c, struct wlr_box *bbox) } void @@ -66,7 +65,7 @@ index dc0c861..621b614 100644 { /* rule matching */ const char *appid, *title; -@@ -472,6 +474,11 @@ applyrules(Client *c) +@@ -496,6 +498,11 @@ applyrules(Client *c) if (r->monitor == i++) mon = m; } @@ -77,9 +76,9 @@ index dc0c861..621b614 100644 + } } } - setmon(c, mon, newtags); -@@ -795,7 +802,7 @@ commitnotify(struct wl_listener *listener, void *data) - * a different monitor based on its title this will likely select + +@@ -864,7 +871,7 @@ commitnotify(struct wl_listener *listener, void *data) + * a different monitor based on its title, this will likely select * a wrong monitor. */ - applyrules(c); @@ -87,7 +86,7 @@ index dc0c861..621b614 100644 if (c->mon) { client_set_scale(client_surface(c), c->mon->wlr_output->scale); } -@@ -1733,7 +1740,7 @@ mapnotify(struct wl_listener *listener, void *data) +@@ -1790,7 +1797,7 @@ mapnotify(struct wl_listener *listener, void *data) c->isfloating = 1; setmon(c, p->mon, p->tags); } else { @@ -96,7 +95,7 @@ index dc0c861..621b614 100644 } printstatus(); -@@ -2769,6 +2776,14 @@ unmapnotify(struct wl_listener *listener, void *data) +@@ -2831,6 +2838,14 @@ unmapnotify(struct wl_listener *listener, void *data) wl_list_remove(&c->flink); } @@ -112,5 +111,5 @@ index dc0c861..621b614 100644 printstatus(); motionnotify(0, NULL, 0, 0, 0, 0); -- -2.46.0 +2.52.0