├── _config.yml ├── tabbed ├── tabbed-center-0.6-20200512-dabf6a2.diff └── tabbed-bottomtabs-0.6-20200512-dabf6a2.diff ├── dwm ├── dwm-toggletag-6.2.diff ├── dwm-toggletag-6.3.diff ├── dwm-toggletag-6.5.diff ├── dwm-toggletag-6.6.diff ├── dwm-sendmon_keepfocus-6.2.diff ├── dwm-sendmon_keepfocus-6.3.diff ├── dwm-sendmon_keepfocus-6.5.diff ├── dwm-sendmon_keepfocus-6.6.diff ├── dwm-togglelayout-6.2.diff ├── dwm-togglelayout-6.3.diff ├── dwm-togglelayout-6.5.diff ├── dwm-togglelayout-6.6.diff ├── dwm-tagmonfixfs-6.2.diff ├── dwm-tagmonfixfs-6.3.diff ├── dwm-tagmonfixfs-6.5.diff ├── dwm-tagmonfixfs-6.6.diff ├── dwm-toggletag-anytag-6.2.diff ├── dwm-toggletag-anytag-6.3.diff ├── dwm-toggletag-anytag-6.5.diff ├── dwm-toggletag-anytag-6.6.diff ├── dwm-fullscreen-compilation-noborder-6.2.diff ├── dwm-fullscreen-compilation-noborder-6.3.diff ├── dwm-pertag-togglelayout-6.2.diff ├── dwm-pertag-togglelayout-6.3.diff ├── dwm-pertag-togglelayout-6.5.diff ├── dwm-pertag-togglelayout-6.6.diff ├── dwm-alpha_monocle_layout-6.2.diff ├── dwm-alpha_monocle_layout-6.3.diff ├── dwm-alpha-monocle_layout-6.2.diff ├── dwm-alpha-monocle_layout-6.3.diff ├── dwm-autostart-6.2.diff ├── dwm-autostart-6.3.diff ├── dwm-use_a_different_font_for_the_status-6.2.diff ├── dwm-desktop-6.2.diff ├── dwm-desktop-6.3.diff ├── dwm-use_a_different_font_for_the_status-6.3.diff ├── dwm-monocle_count-6.3.diff ├── dwm-fullscreen-compilation-rule-6.2.diff ├── dwm-fullscreen-compilation-rule-6.3.diff ├── dwm-spotifyworkaround-6.2.diff ├── dwm-spotifyworkaround-6.3.diff ├── dwm-losefullscreen-6.2.diff ├── dwm-losefullscreen-6.3.diff ├── dwm-losefullscreen-6.5.diff ├── dwm-losefullscreen-6.6.diff ├── dwm-tabbed_fickering_after_xdotool_windowreparent_workaround-6.3.diff ├── dwm-tabbed_flickering_after_xdotool_windowreparent_workaround-6.3.diff ├── dwm-togglefullscreen-6.2.diff ├── dwm-togglefullscreen-6.3.diff ├── dwm-savefloats-6.2.diff ├── dwm-savefloats-6.3.diff ├── dwm-togglefullscreen-6.5.diff ├── dwm-togglefullscreen-6.6.diff ├── dwm-banish-cursorwarp-6.4.diff ├── dwm-banish-cursorwarp-6.5.diff ├── dwm-banish-cursorwarp-6.6.diff ├── dwm-tagicons-selected-6.5.diff ├── dwm-tagicons-selected-6.6.diff ├── dwm-no_border_for_unselected_clients-6.3.diff ├── dwm-no_border_for_unselected_clients-6.5.diff ├── dwm-no_border_for_unselected_clients-6.6.diff ├── dwm-no-border-for-unselected-clients-20200922-61bb8b2.diff ├── dwm-focusonnetactive-6.2.diff ├── dwm-focusonnetactive-6.3.diff ├── dwm-tagicons-selected-6.2.diff ├── dwm-tagicons-selected-6.3.diff ├── dwm-attachbottom-6.5.diff ├── dwm-attachbottom-6.6.diff ├── dwm-attachbottom-6.2.diff ├── dwm-attachbottom-6.3.diff ├── dwm-statuspadding-6.2.diff ├── dwm-statuspadding-6.3.diff ├── dwm-warp-6.2.diff ├── dwm-warp-6.3.diff ├── dwm-desktop_icons-6.2.diff ├── dwm-desktop_icons-6.3.diff ├── dwm-desktop_icons-6.5.diff ├── dwm-desktop_icons-6.6.diff ├── dwm-steam-6.2.diff ├── dwm-steam-6.3.diff ├── dwm-steam-6.5.diff ├── dwm-steam-6.6.diff ├── dwm-centeredsizehints-6.5.diff ├── dwm-centeredsizehints-6.6.diff ├── dwm-losefullscreen-6.2.orig.diff ├── dwm-zero_depth_safeguard-6.2.diff ├── dwm-zero_depth_safeguard-6.3.diff ├── dwm-zero_depth_safeguard-6.6.diff ├── dwm-centeredsizehints-6.2.diff ├── dwm-centeredsizehints-6.3.diff ├── dwm-sortscreens-6.5.diff ├── dwm-sortscreens-6.6.diff ├── dwm-tagallmon-6.2.diff ├── dwm-tagallmon-6.3.diff ├── dwm-tagallmon-6.5.diff ├── dwm-tagallmon-6.6.diff ├── dwm-fullscreen-compilation-tagallmon-6.2.diff ├── dwm-fullscreen-compilation-tagallmon-6.3.diff ├── dwm-sortscreens-20191007-cb3f58a.diff ├── dwm-lock_masks-6.4.diff ├── dwm-lock_masks-6.5.diff ├── dwm-lock_masks-6.6.diff ├── dwm-respectsizehintsrule-6.3.diff ├── dwm-restrictfocus-6.4.diff ├── dwm-shiftviewclients-6.2.diff └── dwm-shiftviewclients-6.3.diff ├── README.md ├── st ├── st-no_window_decorations-0.8.5-20220824-72fd327.diff ├── st-anysize-simple-0.9-20230207-211964d.diff └── st-default_cursor-0.9-20230207-211964d.diff └── dmenu ├── dmenu-barpadding-5.3.diff └── dmenu-barpadding-5.0_20210725_523aa08.diff /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal -------------------------------------------------------------------------------- /tabbed/tabbed-center-0.6-20200512-dabf6a2.diff: -------------------------------------------------------------------------------- 1 | From 679297c1dcf3c5e768608629e0154ebd648c196a Mon Sep 17 00:00:00 2001 2 | From: bakkeby 3 | Date: Mon, 26 Jul 2021 08:56:09 +0200 4 | Subject: [PATCH] Centers window titles within tabs 5 | 6 | Ref. 7 | https://www.reddit.com/r/suckless/comments/oi4zjl/tabbed_text_alignment/ 8 | --- 9 | tabbed.c | 2 ++ 10 | 1 file changed, 2 insertions(+) 11 | 12 | diff --git a/tabbed.c b/tabbed.c 13 | index eafe28a..52039eb 100644 14 | --- a/tabbed.c 15 | +++ b/tabbed.c 16 | @@ -406,6 +406,8 @@ drawtext(const char *text, XftColor col[ColLast]) 17 | buf[--i] = titletrim[--j]) 18 | ; 19 | } 20 | + else 21 | + x += (dc.w - TEXTW(buf)) / 2; // center text 22 | 23 | d = XftDrawCreate(dpy, dc.drawable, DefaultVisual(dpy, screen), DefaultColormap(dpy, screen)); 24 | XftDrawStringUtf8(d, &col[ColFG], dc.font.xfont, x, y, (XftChar8 *) buf, len); 25 | -- 26 | 2.45.2 27 | 28 | -------------------------------------------------------------------------------- /dwm/dwm-toggletag-6.2.diff: -------------------------------------------------------------------------------- 1 | From bae36f3890de94207d3924d6943823e8d7dd12e2 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:43:49 +0200 4 | Subject: [PATCH] toggletag patch 5 | 6 | Keyboard shortcuts to view a given tag will toggle to the 7 | previous layout if the given tag is already active. 8 | --- 9 | dwm.c | 4 +++- 10 | 1 file changed, 3 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/dwm.c b/dwm.c 13 | index 4465af1..992d6ab 100644 14 | --- a/dwm.c 15 | +++ b/dwm.c 16 | @@ -2035,8 +2035,10 @@ updatewmhints(Client *c) 17 | void 18 | view(const Arg *arg) 19 | { 20 | - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) 21 | + if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) { 22 | + view(&((Arg) { .ui = 0 })); 23 | return; 24 | + } 25 | selmon->seltags ^= 1; /* toggle sel tagset */ 26 | if (arg->ui & TAGMASK) 27 | selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; 28 | -- 29 | 2.45.2 30 | 31 | -------------------------------------------------------------------------------- /dwm/dwm-toggletag-6.3.diff: -------------------------------------------------------------------------------- 1 | From c336441965af8aa37b46c69e5b27ef8c9bcde437 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:44:04 +0200 4 | Subject: [PATCH] toggletag patch 5 | 6 | Keyboard shortcuts to view a given tag will toggle to the 7 | previous layout if the given tag is already active. 8 | --- 9 | dwm.c | 4 +++- 10 | 1 file changed, 3 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/dwm.c b/dwm.c 13 | index a96f33c..68ceea2 100644 14 | --- a/dwm.c 15 | +++ b/dwm.c 16 | @@ -2041,8 +2041,10 @@ updatewmhints(Client *c) 17 | void 18 | view(const Arg *arg) 19 | { 20 | - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) 21 | + if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) { 22 | + view(&((Arg) { .ui = 0 })); 23 | return; 24 | + } 25 | selmon->seltags ^= 1; /* toggle sel tagset */ 26 | if (arg->ui & TAGMASK) 27 | selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; 28 | -- 29 | 2.45.2 30 | 31 | -------------------------------------------------------------------------------- /dwm/dwm-toggletag-6.5.diff: -------------------------------------------------------------------------------- 1 | From 00b7b697f47694c7b637c6cbf0f528b001c052f5 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:44:04 +0200 4 | Subject: [PATCH] toggletag patch 5 | 6 | Keyboard shortcuts to view a given tag will toggle to the 7 | previous layout if the given tag is already active. 8 | --- 9 | dwm.c | 4 +++- 10 | 1 file changed, 3 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/dwm.c b/dwm.c 13 | index f1d86b2..3002d51 100644 14 | --- a/dwm.c 15 | +++ b/dwm.c 16 | @@ -2053,8 +2053,10 @@ updatewmhints(Client *c) 17 | void 18 | view(const Arg *arg) 19 | { 20 | - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) 21 | + if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) { 22 | + view(&((Arg) { .ui = 0 })); 23 | return; 24 | + } 25 | selmon->seltags ^= 1; /* toggle sel tagset */ 26 | if (arg->ui & TAGMASK) 27 | selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; 28 | -- 29 | 2.45.2 30 | 31 | -------------------------------------------------------------------------------- /dwm/dwm-toggletag-6.6.diff: -------------------------------------------------------------------------------- 1 | From a5d1118e79a236025d595597b339a273cc8a6b07 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:44:04 +0200 4 | Subject: [PATCH] toggletag patch 5 | 6 | Keyboard shortcuts to view a given tag will toggle to the 7 | previous layout if the given tag is already active. 8 | --- 9 | dwm.c | 4 +++- 10 | 1 file changed, 3 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/dwm.c b/dwm.c 13 | index 1443802..2f571d5 100644 14 | --- a/dwm.c 15 | +++ b/dwm.c 16 | @@ -2052,8 +2052,10 @@ updatewmhints(Client *c) 17 | void 18 | view(const Arg *arg) 19 | { 20 | - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) 21 | + if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) { 22 | + view(&((Arg) { .ui = 0 })); 23 | return; 24 | + } 25 | selmon->seltags ^= 1; /* toggle sel tagset */ 26 | if (arg->ui & TAGMASK) 27 | selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; 28 | -- 29 | 2.50.1 30 | 31 | -------------------------------------------------------------------------------- /dwm/dwm-sendmon_keepfocus-6.2.diff: -------------------------------------------------------------------------------- 1 | From 812695104701acaaa5b31afad08fdb576486ae72 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Thu, 27 Jun 2024 17:55:57 +0200 4 | Subject: [PATCH] sendmon_keepfocus patch 5 | 6 | --- 7 | dwm.c | 10 ++++++++-- 8 | 1 file changed, 8 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index 4465af1..2def4a1 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -1412,15 +1412,21 @@ sendmon(Client *c, Monitor *m) 15 | { 16 | if (c->mon == m) 17 | return; 18 | + int hadfocus = (c == selmon->sel); 19 | unfocus(c, 1); 20 | detach(c); 21 | detachstack(c); 22 | + arrange(c->mon); 23 | c->mon = m; 24 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 25 | attach(c); 26 | attachstack(c); 27 | - focus(NULL); 28 | - arrange(NULL); 29 | + arrange(m); 30 | + if (hadfocus) { 31 | + focus(c); 32 | + restack(m); 33 | + } else 34 | + focus(NULL); 35 | } 36 | 37 | void 38 | -- 39 | 2.45.2 40 | 41 | -------------------------------------------------------------------------------- /dwm/dwm-sendmon_keepfocus-6.3.diff: -------------------------------------------------------------------------------- 1 | From 55f8b13f93402967d1cbe21489fc4998baf559cb Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Thu, 27 Jun 2024 17:56:24 +0200 4 | Subject: [PATCH] sendmon_keepfocus patch 5 | 6 | --- 7 | dwm.c | 10 ++++++++-- 8 | 1 file changed, 8 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index a96f33c..f46e77e 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -1416,15 +1416,21 @@ sendmon(Client *c, Monitor *m) 15 | { 16 | if (c->mon == m) 17 | return; 18 | + int hadfocus = (c == selmon->sel); 19 | unfocus(c, 1); 20 | detach(c); 21 | detachstack(c); 22 | + arrange(c->mon); 23 | c->mon = m; 24 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 25 | attach(c); 26 | attachstack(c); 27 | - focus(NULL); 28 | - arrange(NULL); 29 | + arrange(m); 30 | + if (hadfocus) { 31 | + focus(c); 32 | + restack(m); 33 | + } else 34 | + focus(NULL); 35 | } 36 | 37 | void 38 | -- 39 | 2.45.2 40 | 41 | -------------------------------------------------------------------------------- /dwm/dwm-sendmon_keepfocus-6.5.diff: -------------------------------------------------------------------------------- 1 | From b5d81118339d99e91910b0e2e682abc70abf27ea Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Thu, 27 Jun 2024 17:56:24 +0200 4 | Subject: [PATCH] sendmon_keepfocus patch 5 | 6 | --- 7 | dwm.c | 10 ++++++++-- 8 | 1 file changed, 8 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index f1d86b2..8422147 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -1422,15 +1422,21 @@ sendmon(Client *c, Monitor *m) 15 | { 16 | if (c->mon == m) 17 | return; 18 | + int hadfocus = (c == selmon->sel); 19 | unfocus(c, 1); 20 | detach(c); 21 | detachstack(c); 22 | + arrange(c->mon); 23 | c->mon = m; 24 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 25 | attach(c); 26 | attachstack(c); 27 | - focus(NULL); 28 | - arrange(NULL); 29 | + arrange(m); 30 | + if (hadfocus) { 31 | + focus(c); 32 | + restack(m); 33 | + } else 34 | + focus(NULL); 35 | } 36 | 37 | void 38 | -- 39 | 2.45.2 40 | 41 | -------------------------------------------------------------------------------- /dwm/dwm-sendmon_keepfocus-6.6.diff: -------------------------------------------------------------------------------- 1 | From e221ba9fdecdc2f121df52e7561aa28936abff50 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Thu, 27 Jun 2024 17:56:24 +0200 4 | Subject: [PATCH] sendmon_keepfocus patch 5 | 6 | --- 7 | dwm.c | 10 ++++++++-- 8 | 1 file changed, 8 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index 1443802..3d08f7d 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -1421,15 +1421,21 @@ sendmon(Client *c, Monitor *m) 15 | { 16 | if (c->mon == m) 17 | return; 18 | + int hadfocus = (c == selmon->sel); 19 | unfocus(c, 1); 20 | detach(c); 21 | detachstack(c); 22 | + arrange(c->mon); 23 | c->mon = m; 24 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 25 | attach(c); 26 | attachstack(c); 27 | - focus(NULL); 28 | - arrange(NULL); 29 | + arrange(m); 30 | + if (hadfocus) { 31 | + focus(c); 32 | + restack(m); 33 | + } else 34 | + focus(NULL); 35 | } 36 | 37 | void 38 | -- 39 | 2.50.1 40 | 41 | -------------------------------------------------------------------------------- /dwm/dwm-togglelayout-6.2.diff: -------------------------------------------------------------------------------- 1 | From d2ac0dcd26cef9035f5224f6b416ccba6c0a3ace Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:49:27 +0200 4 | Subject: [PATCH] togglelayout patch 5 | 6 | Keyboard shortcuts to set a given layout will toggle to the 7 | previous layout if the given layout is already active. 8 | --- 9 | dwm.c | 5 ++--- 10 | 1 file changed, 2 insertions(+), 3 deletions(-) 11 | 12 | diff --git a/dwm.c b/dwm.c 13 | index 4465af1..2604ff6 100644 14 | --- a/dwm.c 15 | +++ b/dwm.c 16 | @@ -1500,9 +1500,8 @@ setfullscreen(Client *c, int fullscreen) 17 | void 18 | setlayout(const Arg *arg) 19 | { 20 | - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) 21 | - selmon->sellt ^= 1; 22 | - if (arg && arg->v) 23 | + selmon->sellt ^= 1; 24 | + if (arg && arg->v && arg->v != selmon->lt[selmon->sellt ^ 1]) 25 | selmon->lt[selmon->sellt] = (Layout *)arg->v; 26 | strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); 27 | if (selmon->sel) 28 | -- 29 | 2.45.2 30 | 31 | -------------------------------------------------------------------------------- /dwm/dwm-togglelayout-6.3.diff: -------------------------------------------------------------------------------- 1 | From 825f7750ac9c9ca883f4146cde74c4156159a589 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:49:38 +0200 4 | Subject: [PATCH] togglelayout patch 5 | 6 | Keyboard shortcuts to set a given layout will toggle to the 7 | previous layout if the given layout is already active. 8 | --- 9 | dwm.c | 5 ++--- 10 | 1 file changed, 2 insertions(+), 3 deletions(-) 11 | 12 | diff --git a/dwm.c b/dwm.c 13 | index a96f33c..9006fef 100644 14 | --- a/dwm.c 15 | +++ b/dwm.c 16 | @@ -1504,9 +1504,8 @@ setfullscreen(Client *c, int fullscreen) 17 | void 18 | setlayout(const Arg *arg) 19 | { 20 | - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) 21 | - selmon->sellt ^= 1; 22 | - if (arg && arg->v) 23 | + selmon->sellt ^= 1; 24 | + if (arg && arg->v && arg->v != selmon->lt[selmon->sellt ^ 1]) 25 | selmon->lt[selmon->sellt] = (Layout *)arg->v; 26 | strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); 27 | if (selmon->sel) 28 | -- 29 | 2.45.2 30 | 31 | -------------------------------------------------------------------------------- /dwm/dwm-togglelayout-6.5.diff: -------------------------------------------------------------------------------- 1 | From b8908297448a84808f3ffd415d6028f3c065e90f Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:49:38 +0200 4 | Subject: [PATCH] togglelayout patch 5 | 6 | Keyboard shortcuts to set a given layout will toggle to the 7 | previous layout if the given layout is already active. 8 | --- 9 | dwm.c | 5 ++--- 10 | 1 file changed, 2 insertions(+), 3 deletions(-) 11 | 12 | diff --git a/dwm.c b/dwm.c 13 | index f1d86b2..0101950 100644 14 | --- a/dwm.c 15 | +++ b/dwm.c 16 | @@ -1510,9 +1510,8 @@ setfullscreen(Client *c, int fullscreen) 17 | void 18 | setlayout(const Arg *arg) 19 | { 20 | - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) 21 | - selmon->sellt ^= 1; 22 | - if (arg && arg->v) 23 | + selmon->sellt ^= 1; 24 | + if (arg && arg->v && arg->v != selmon->lt[selmon->sellt ^ 1]) 25 | selmon->lt[selmon->sellt] = (Layout *)arg->v; 26 | strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); 27 | if (selmon->sel) 28 | -- 29 | 2.45.2 30 | 31 | -------------------------------------------------------------------------------- /dwm/dwm-togglelayout-6.6.diff: -------------------------------------------------------------------------------- 1 | From 48179b0e030ef244da64afb40c22ce8553e8ba74 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:49:38 +0200 4 | Subject: [PATCH] togglelayout patch 5 | 6 | Keyboard shortcuts to set a given layout will toggle to the 7 | previous layout if the given layout is already active. 8 | --- 9 | dwm.c | 5 ++--- 10 | 1 file changed, 2 insertions(+), 3 deletions(-) 11 | 12 | diff --git a/dwm.c b/dwm.c 13 | index 1443802..1868aba 100644 14 | --- a/dwm.c 15 | +++ b/dwm.c 16 | @@ -1509,9 +1509,8 @@ setfullscreen(Client *c, int fullscreen) 17 | void 18 | setlayout(const Arg *arg) 19 | { 20 | - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) 21 | - selmon->sellt ^= 1; 22 | - if (arg && arg->v) 23 | + selmon->sellt ^= 1; 24 | + if (arg && arg->v && arg->v != selmon->lt[selmon->sellt ^ 1]) 25 | selmon->lt[selmon->sellt] = (Layout *)arg->v; 26 | strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); 27 | if (selmon->sel) 28 | -- 29 | 2.50.1 30 | 31 | -------------------------------------------------------------------------------- /dwm/dwm-tagmonfixfs-6.2.diff: -------------------------------------------------------------------------------- 1 | From b0b2b0e78cac878553f7dec06b813bf12343ecd9 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:52:22 +0200 4 | Subject: [PATCH] tagmonfixfs 5 | 6 | Allow moving a fullscreen window to another monitor while it remains in fullscreen. 7 | --- 8 | dwm.c | 12 ++++++++++-- 9 | 1 file changed, 10 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index 4465af1..39cece0 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -1665,9 +1665,17 @@ tag(const Arg *arg) 16 | void 17 | tagmon(const Arg *arg) 18 | { 19 | - if (!selmon->sel || !mons->next) 20 | + Client *c = selmon->sel; 21 | + if (!c || !mons->next) 22 | return; 23 | - sendmon(selmon->sel, dirtomon(arg->i)); 24 | + if (c->isfullscreen) { 25 | + c->isfullscreen = 0; 26 | + sendmon(c, dirtomon(arg->i)); 27 | + c->isfullscreen = 1; 28 | + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); 29 | + XRaiseWindow(dpy, c->win); 30 | + } else 31 | + sendmon(c, dirtomon(arg->i)); 32 | } 33 | 34 | void 35 | -- 36 | 2.45.2 37 | 38 | -------------------------------------------------------------------------------- /dwm/dwm-tagmonfixfs-6.3.diff: -------------------------------------------------------------------------------- 1 | From e7cac6cdbb2343a25eaaccbd5de0a907fa4cb164 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:52:31 +0200 4 | Subject: [PATCH] tagmonfixfs 5 | 6 | Allow moving a fullscreen window to another monitor while it remains in fullscreen. 7 | --- 8 | dwm.c | 12 ++++++++++-- 9 | 1 file changed, 10 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index a96f33c..d340599 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -1669,9 +1669,17 @@ tag(const Arg *arg) 16 | void 17 | tagmon(const Arg *arg) 18 | { 19 | - if (!selmon->sel || !mons->next) 20 | + Client *c = selmon->sel; 21 | + if (!c || !mons->next) 22 | return; 23 | - sendmon(selmon->sel, dirtomon(arg->i)); 24 | + if (c->isfullscreen) { 25 | + c->isfullscreen = 0; 26 | + sendmon(c, dirtomon(arg->i)); 27 | + c->isfullscreen = 1; 28 | + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); 29 | + XRaiseWindow(dpy, c->win); 30 | + } else 31 | + sendmon(c, dirtomon(arg->i)); 32 | } 33 | 34 | void 35 | -- 36 | 2.45.2 37 | 38 | -------------------------------------------------------------------------------- /dwm/dwm-tagmonfixfs-6.5.diff: -------------------------------------------------------------------------------- 1 | From 8425a1a0c190a7a2d328d8988cc374ae2cef1bfe Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:52:31 +0200 4 | Subject: [PATCH] tagmonfixfs 5 | 6 | Allow moving a fullscreen window to another monitor while it remains in fullscreen. 7 | --- 8 | dwm.c | 12 ++++++++++-- 9 | 1 file changed, 10 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index f1d86b2..6d45ece 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -1679,9 +1679,17 @@ tag(const Arg *arg) 16 | void 17 | tagmon(const Arg *arg) 18 | { 19 | - if (!selmon->sel || !mons->next) 20 | + Client *c = selmon->sel; 21 | + if (!c || !mons->next) 22 | return; 23 | - sendmon(selmon->sel, dirtomon(arg->i)); 24 | + if (c->isfullscreen) { 25 | + c->isfullscreen = 0; 26 | + sendmon(c, dirtomon(arg->i)); 27 | + c->isfullscreen = 1; 28 | + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); 29 | + XRaiseWindow(dpy, c->win); 30 | + } else 31 | + sendmon(c, dirtomon(arg->i)); 32 | } 33 | 34 | void 35 | -- 36 | 2.45.2 37 | 38 | -------------------------------------------------------------------------------- /dwm/dwm-tagmonfixfs-6.6.diff: -------------------------------------------------------------------------------- 1 | From 61a031b55f9eff90b6f548f7ee8aeb4132c0db2f Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:52:31 +0200 4 | Subject: [PATCH] tagmonfixfs 5 | 6 | Allow moving a fullscreen window to another monitor while it remains in fullscreen. 7 | --- 8 | dwm.c | 12 ++++++++++-- 9 | 1 file changed, 10 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index 1443802..5be32c9 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -1678,9 +1678,17 @@ tag(const Arg *arg) 16 | void 17 | tagmon(const Arg *arg) 18 | { 19 | - if (!selmon->sel || !mons->next) 20 | + Client *c = selmon->sel; 21 | + if (!c || !mons->next) 22 | return; 23 | - sendmon(selmon->sel, dirtomon(arg->i)); 24 | + if (c->isfullscreen) { 25 | + c->isfullscreen = 0; 26 | + sendmon(c, dirtomon(arg->i)); 27 | + c->isfullscreen = 1; 28 | + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); 29 | + XRaiseWindow(dpy, c->win); 30 | + } else 31 | + sendmon(c, dirtomon(arg->i)); 32 | } 33 | 34 | void 35 | -- 36 | 2.50.1 37 | 38 | -------------------------------------------------------------------------------- /dwm/dwm-toggletag-anytag-6.2.diff: -------------------------------------------------------------------------------- 1 | From f16e4fc5160275643fe62eb65c6f2d7f61ca5245 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:47:35 +0200 4 | Subject: [PATCH] toggletag - anytag patch 5 | 6 | This is a variant of the toggletag patch. 7 | 8 | Keyboard shortcuts to view a given tag will toggle to the previous layout 9 | if the given tag is already active or if the tag was previously selected. 10 | --- 11 | dwm.c | 5 ++++- 12 | 1 file changed, 4 insertions(+), 1 deletion(-) 13 | 14 | diff --git a/dwm.c b/dwm.c 15 | index 4465af1..25b9ec1 100644 16 | --- a/dwm.c 17 | +++ b/dwm.c 18 | @@ -2035,8 +2035,11 @@ updatewmhints(Client *c) 19 | void 20 | view(const Arg *arg) 21 | { 22 | - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) 23 | + if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags] 24 | + || ((arg->ui & TAGMASK) & selmon->tagset[selmon->seltags^1])) { 25 | + view(&((Arg) { .ui = 0 })); 26 | return; 27 | + } 28 | selmon->seltags ^= 1; /* toggle sel tagset */ 29 | if (arg->ui & TAGMASK) 30 | selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; 31 | -- 32 | 2.45.2 33 | 34 | -------------------------------------------------------------------------------- /dwm/dwm-toggletag-anytag-6.3.diff: -------------------------------------------------------------------------------- 1 | From 7339c393f43bf2fa08edae46ab8f3471924a2659 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:48:40 +0200 4 | Subject: [PATCH] toggletag - anytag patch 5 | 6 | This is a variant of the toggletag patch. 7 | 8 | Keyboard shortcuts to view a given tag will toggle to the previous layout 9 | if the given tag is already active or if the tag was previously selected. 10 | --- 11 | dwm.c | 5 ++++- 12 | 1 file changed, 4 insertions(+), 1 deletion(-) 13 | 14 | diff --git a/dwm.c b/dwm.c 15 | index a96f33c..c7dcc98 100644 16 | --- a/dwm.c 17 | +++ b/dwm.c 18 | @@ -2041,8 +2041,11 @@ updatewmhints(Client *c) 19 | void 20 | view(const Arg *arg) 21 | { 22 | - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) 23 | + if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags] 24 | + || ((arg->ui & TAGMASK) & selmon->tagset[selmon->seltags^1])) { 25 | + view(&((Arg) { .ui = 0 })); 26 | return; 27 | + } 28 | selmon->seltags ^= 1; /* toggle sel tagset */ 29 | if (arg->ui & TAGMASK) 30 | selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; 31 | -- 32 | 2.45.2 33 | 34 | -------------------------------------------------------------------------------- /dwm/dwm-toggletag-anytag-6.5.diff: -------------------------------------------------------------------------------- 1 | From 1dbf295ddb36fc7628dcc8d7a9d24fc92ee8500f Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:48:40 +0200 4 | Subject: [PATCH] toggletag - anytag patch 5 | 6 | This is a variant of the toggletag patch. 7 | 8 | Keyboard shortcuts to view a given tag will toggle to the previous layout 9 | if the given tag is already active or if the tag was previously selected. 10 | --- 11 | dwm.c | 5 ++++- 12 | 1 file changed, 4 insertions(+), 1 deletion(-) 13 | 14 | diff --git a/dwm.c b/dwm.c 15 | index f1d86b2..c64036f 100644 16 | --- a/dwm.c 17 | +++ b/dwm.c 18 | @@ -2053,8 +2053,11 @@ updatewmhints(Client *c) 19 | void 20 | view(const Arg *arg) 21 | { 22 | - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) 23 | + if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags] 24 | + || ((arg->ui & TAGMASK) & selmon->tagset[selmon->seltags^1])) { 25 | + view(&((Arg) { .ui = 0 })); 26 | return; 27 | + } 28 | selmon->seltags ^= 1; /* toggle sel tagset */ 29 | if (arg->ui & TAGMASK) 30 | selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; 31 | -- 32 | 2.45.2 33 | 34 | -------------------------------------------------------------------------------- /dwm/dwm-toggletag-anytag-6.6.diff: -------------------------------------------------------------------------------- 1 | From 876440da458ddb91add046962f45121d1c471f15 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:48:40 +0200 4 | Subject: [PATCH] toggletag - anytag patch 5 | 6 | This is a variant of the toggletag patch. 7 | 8 | Keyboard shortcuts to view a given tag will toggle to the previous layout 9 | if the given tag is already active or if the tag was previously selected. 10 | --- 11 | dwm.c | 5 ++++- 12 | 1 file changed, 4 insertions(+), 1 deletion(-) 13 | 14 | diff --git a/dwm.c b/dwm.c 15 | index 1443802..1727b61 100644 16 | --- a/dwm.c 17 | +++ b/dwm.c 18 | @@ -2052,8 +2052,11 @@ updatewmhints(Client *c) 19 | void 20 | view(const Arg *arg) 21 | { 22 | - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) 23 | + if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags] 24 | + || ((arg->ui & TAGMASK) & selmon->tagset[selmon->seltags^1])) { 25 | + view(&((Arg) { .ui = 0 })); 26 | return; 27 | + } 28 | selmon->seltags ^= 1; /* toggle sel tagset */ 29 | if (arg->ui & TAGMASK) 30 | selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; 31 | -- 32 | 2.50.1 33 | 34 | -------------------------------------------------------------------------------- /dwm/dwm-fullscreen-compilation-noborder-6.2.diff: -------------------------------------------------------------------------------- 1 | From 7568744554792a48081b6334f4d4d99a438bf634 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:15:14 +0200 4 | Subject: [PATCH 2/2] Adding fake fullscreen compatible noborder patch 5 | 6 | --- 7 | dwm.c | 9 +++++++++ 8 | 1 file changed, 9 insertions(+) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index 763c224..15849a3 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -1309,6 +1309,15 @@ resizeclient(Client *c, int x, int y, int w, int h) 15 | c->oldw = c->w; c->w = wc.width = w; 16 | c->oldh = c->h; c->h = wc.height = h; 17 | wc.border_width = c->bw; 18 | + if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next)) 19 | + || &monocle == c->mon->lt[c->mon->sellt]->arrange) 20 | + && (c->fakefullscreen == 1 || !c->isfullscreen) 21 | + && !c->isfloating 22 | + && c->mon->lt[c->mon->sellt]->arrange) { 23 | + c->w = wc.width += c->bw * 2; 24 | + c->h = wc.height += c->bw * 2; 25 | + wc.border_width = 0; 26 | + } 27 | XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); 28 | configure(c); 29 | XSync(dpy, False); 30 | -- 31 | 2.45.2 32 | 33 | -------------------------------------------------------------------------------- /dwm/dwm-fullscreen-compilation-noborder-6.3.diff: -------------------------------------------------------------------------------- 1 | From 9e621b2da0e43f670c869fb74ef4b5f527a3a8b7 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:15:33 +0200 4 | Subject: [PATCH 2/2] Adding fake fullscreen compatible noborder patch 5 | 6 | --- 7 | dwm.c | 9 +++++++++ 8 | 1 file changed, 9 insertions(+) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index 53f0bd4..972e8cd 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -1307,6 +1307,15 @@ resizeclient(Client *c, int x, int y, int w, int h) 15 | c->oldw = c->w; c->w = wc.width = w; 16 | c->oldh = c->h; c->h = wc.height = h; 17 | wc.border_width = c->bw; 18 | + if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next)) 19 | + || &monocle == c->mon->lt[c->mon->sellt]->arrange) 20 | + && (c->fakefullscreen == 1 || !c->isfullscreen) 21 | + && !c->isfloating 22 | + && c->mon->lt[c->mon->sellt]->arrange) { 23 | + c->w = wc.width += c->bw * 2; 24 | + c->h = wc.height += c->bw * 2; 25 | + wc.border_width = 0; 26 | + } 27 | XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); 28 | configure(c); 29 | XSync(dpy, False); 30 | -- 31 | 2.45.2 32 | 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Patches 2 | This repository contains a selection of patches for suckless projects. 3 | 4 | Most of these are derived from the flexipatch projects, e.g. [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch), and it should be noted that some of them have cross-patch compatibility built-in using the same preprocessor directives as used in the flexipatch builds. 5 | One good example of this is the [dragmfact](https://github.com/bakkeby/patches/blob/master/dwm/dwm-dragmfact-6.2.diff) patch which can involve up to 11 additional patches. Due to the many possible patch combinations I have decided to leave these preprocessor directives in there as a form of guide for integrating this into your own build - the idea being that you manually delete the code that you don't need. 6 | 7 | For cascading patches, e.g. dragcfact on top of cfacts, sub-patches will only contain their relevant change. This is to make it easier to apply multiple sub-patches. 8 | This means that in order to apply the dragcfact patch ([dwm-cfacts-dragcfact-6.2.diff](https://github.com/bakkeby/patches/blob/master/dwm/dwm-cfacts-dragcfact-6.2.diff)) you would have to apply the [cfacts](https://github.com/bakkeby/patches/blob/master/dwm/dwm-cfacts-6.2.diff) patch first if you do not already have it. -------------------------------------------------------------------------------- /dwm/dwm-pertag-togglelayout-6.2.diff: -------------------------------------------------------------------------------- 1 | From 9ac47de0be04ace2096663eaef35d75555e0bdd2 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Fri, 28 Jun 2024 18:14:28 +0200 4 | Subject: [PATCH 2/2] togglelayout patch 5 | 6 | Keyboard shortcuts to set a given layout will toggle to the previous layout if the given layout is already active. 7 | --- 8 | dwm.c | 8 +++----- 9 | 1 file changed, 3 insertions(+), 5 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index 466177c..df25a2d 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -1538,11 +1538,9 @@ setfullscreen(Client *c, int fullscreen) 16 | void 17 | setlayout(const Arg *arg) 18 | { 19 | - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) { 20 | - selmon->pertag->sellts[selmon->pertag->curtag] ^= 1; 21 | - selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; 22 | - } 23 | - if (arg && arg->v) 24 | + selmon->pertag->sellts[selmon->pertag->curtag] ^= 1; 25 | + selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; 26 | + if (arg && arg->v && arg->v != selmon->lt[selmon->sellt ^ 1]) 27 | selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v; 28 | selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; 29 | strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); 30 | -- 31 | 2.45.2 32 | 33 | -------------------------------------------------------------------------------- /dwm/dwm-pertag-togglelayout-6.3.diff: -------------------------------------------------------------------------------- 1 | From 66b00ac80428598b20b6115c15311ecb371dee63 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Fri, 28 Jun 2024 18:15:07 +0200 4 | Subject: [PATCH 2/2] togglelayout patch 5 | 6 | Keyboard shortcuts to set a given layout will toggle to the previous layout if the given layout is already active. 7 | --- 8 | dwm.c | 8 +++----- 9 | 1 file changed, 3 insertions(+), 5 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index b8ae4a5..c4b3166 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -1542,11 +1542,9 @@ setfullscreen(Client *c, int fullscreen) 16 | void 17 | setlayout(const Arg *arg) 18 | { 19 | - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) { 20 | - selmon->pertag->sellts[selmon->pertag->curtag] ^= 1; 21 | - selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; 22 | - } 23 | - if (arg && arg->v) 24 | + selmon->pertag->sellts[selmon->pertag->curtag] ^= 1; 25 | + selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; 26 | + if (arg && arg->v && arg->v != selmon->lt[selmon->sellt ^ 1]) 27 | selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v; 28 | selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; 29 | strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); 30 | -- 31 | 2.45.2 32 | 33 | -------------------------------------------------------------------------------- /dwm/dwm-pertag-togglelayout-6.5.diff: -------------------------------------------------------------------------------- 1 | From eea013c24f035023d5ec1d39dcfe55990b466352 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 23:43:03 +0200 4 | Subject: [PATCH 2/2] togglelayout patch 5 | 6 | Keyboard shortcuts to set a given layout will toggle to the previous layout if the given layout is already active. 7 | --- 8 | dwm.c | 8 +++----- 9 | 1 file changed, 3 insertions(+), 5 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index ab1edb6..eeb031c 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -1548,11 +1548,9 @@ setfullscreen(Client *c, int fullscreen) 16 | void 17 | setlayout(const Arg *arg) 18 | { 19 | - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) { 20 | - selmon->pertag->sellts[selmon->pertag->curtag] ^= 1; 21 | - selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; 22 | - } 23 | - if (arg && arg->v) 24 | + selmon->pertag->sellts[selmon->pertag->curtag] ^= 1; 25 | + selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; 26 | + if (arg && arg->v && arg->v != selmon->lt[selmon->sellt ^ 1]) 27 | selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v; 28 | selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; 29 | strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); 30 | -- 31 | 2.45.2 32 | 33 | -------------------------------------------------------------------------------- /dwm/dwm-pertag-togglelayout-6.6.diff: -------------------------------------------------------------------------------- 1 | From fe671835ab01e24a9f43d066dc573725fb475db4 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 23:43:03 +0200 4 | Subject: [PATCH 2/2] togglelayout patch 5 | 6 | Keyboard shortcuts to set a given layout will toggle to the previous layout if the given layout is already active. 7 | --- 8 | dwm.c | 8 +++----- 9 | 1 file changed, 3 insertions(+), 5 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index bfacc07..c79188c 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -1547,11 +1547,9 @@ setfullscreen(Client *c, int fullscreen) 16 | void 17 | setlayout(const Arg *arg) 18 | { 19 | - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) { 20 | - selmon->pertag->sellts[selmon->pertag->curtag] ^= 1; 21 | - selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; 22 | - } 23 | - if (arg && arg->v) 24 | + selmon->pertag->sellts[selmon->pertag->curtag] ^= 1; 25 | + selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; 26 | + if (arg && arg->v && arg->v != selmon->lt[selmon->sellt ^ 1]) 27 | selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v; 28 | selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; 29 | strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); 30 | -- 31 | 2.50.1 32 | 33 | -------------------------------------------------------------------------------- /dwm/dwm-alpha_monocle_layout-6.2.diff: -------------------------------------------------------------------------------- 1 | From 1574ebb71bfa26e569983ccba58629fd72a5991e Mon Sep 17 00:00:00 2001 2 | From: bakkeby 3 | Date: Tue, 27 Oct 2020 12:20:31 +0100 4 | Subject: [PATCH] alpha monocle layout: only show the currently focused window 5 | (rather than all windows stacked on top of each other) 6 | 7 | --- 8 | dwm.c | 11 ++++++++++- 9 | 1 file changed, 10 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index 4465af1..5ebc90e 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -802,6 +802,8 @@ focus(Client *c) 16 | XDeleteProperty(dpy, root, netatom[NetActiveWindow]); 17 | } 18 | selmon->sel = c; 19 | + if (selmon->lt[selmon->sellt]->arrange == monocle) 20 | + arrangemon(selmon); 21 | drawbars(); 22 | } 23 | 24 | @@ -1111,8 +1113,15 @@ monocle(Monitor *m) 25 | n++; 26 | if (n > 0) /* override layout symbol */ 27 | snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); 28 | - for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) 29 | + for (c = m->stack; c && (!ISVISIBLE(c) || c->isfloating); c = c->snext); 30 | + if (c && !c->isfloating) { 31 | + XMoveWindow(dpy, c->win, m->wx, m->wy); 32 | resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); 33 | + c = c->snext; 34 | + } 35 | + for (; c; c = c->snext) 36 | + if (!c->isfloating && ISVISIBLE(c)) 37 | + XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y); 38 | } 39 | 40 | void 41 | -- 42 | 2.19.1 43 | 44 | -------------------------------------------------------------------------------- /dwm/dwm-alpha_monocle_layout-6.3.diff: -------------------------------------------------------------------------------- 1 | From 945f4d84a9617c26769d2ee9c36d96dc39a5856f Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 10 Jan 2022 11:08:27 +0100 4 | Subject: [PATCH] alpha monocle layout: only show the currently focused window 5 | (rather than all windows stacked on top of each other) 6 | 7 | --- 8 | dwm.c | 11 ++++++++++- 9 | 1 file changed, 10 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index a96f33c..05f9edb 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -806,6 +806,8 @@ focus(Client *c) 16 | XDeleteProperty(dpy, root, netatom[NetActiveWindow]); 17 | } 18 | selmon->sel = c; 19 | + if (selmon->lt[selmon->sellt]->arrange == monocle) 20 | + arrangemon(selmon); 21 | drawbars(); 22 | } 23 | 24 | @@ -1115,8 +1117,15 @@ monocle(Monitor *m) 25 | n++; 26 | if (n > 0) /* override layout symbol */ 27 | snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); 28 | - for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) 29 | + for (c = m->stack; c && (!ISVISIBLE(c) || c->isfloating); c = c->snext); 30 | + if (c && !c->isfloating) { 31 | + XMoveWindow(dpy, c->win, m->wx, m->wy); 32 | resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); 33 | + c = c->snext; 34 | + } 35 | + for (; c; c = c->snext) 36 | + if (!c->isfloating && ISVISIBLE(c)) 37 | + XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y); 38 | } 39 | 40 | void 41 | -- 42 | 2.19.1 43 | 44 | -------------------------------------------------------------------------------- /dwm/dwm-alpha-monocle_layout-6.2.diff: -------------------------------------------------------------------------------- 1 | From 0c1f89828b3a8f8589e4f56f7ea47a476822cdf3 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 24 Jun 2024 09:51:46 +0200 4 | Subject: [PATCH 2/2] alpha monocle layout: only show the currently focused 5 | window (rather than all windows stacked on top of each other) 6 | 7 | --- 8 | dwm.c | 11 ++++++++++- 9 | 1 file changed, 10 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index 20f8309..40059e4 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -810,6 +810,8 @@ focus(Client *c) 16 | XDeleteProperty(dpy, root, netatom[NetActiveWindow]); 17 | } 18 | selmon->sel = c; 19 | + if (selmon->lt[selmon->sellt]->arrange == monocle) 20 | + arrangemon(selmon); 21 | drawbars(); 22 | } 23 | 24 | @@ -1119,8 +1121,15 @@ monocle(Monitor *m) 25 | n++; 26 | if (n > 0) /* override layout symbol */ 27 | snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); 28 | - for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) 29 | + for (c = m->stack; c && (!ISVISIBLE(c) || c->isfloating); c = c->snext); 30 | + if (c && !c->isfloating) { 31 | + XMoveWindow(dpy, c->win, m->wx, m->wy); 32 | resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); 33 | + c = c->snext; 34 | + } 35 | + for (; c; c = c->snext) 36 | + if (!c->isfloating && ISVISIBLE(c)) 37 | + XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y); 38 | } 39 | 40 | void 41 | -- 42 | 2.45.2 43 | 44 | -------------------------------------------------------------------------------- /dwm/dwm-alpha-monocle_layout-6.3.diff: -------------------------------------------------------------------------------- 1 | From f3331b857bdb29a3b1ad504623a57e10d0949f8f Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 24 Jun 2024 09:52:05 +0200 4 | Subject: [PATCH 2/2] alpha monocle layout: only show the currently focused 5 | window (rather than all windows stacked on top of each other) 6 | 7 | --- 8 | dwm.c | 11 ++++++++++- 9 | 1 file changed, 10 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index 34b9a32..132bc15 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -814,6 +814,8 @@ focus(Client *c) 16 | XDeleteProperty(dpy, root, netatom[NetActiveWindow]); 17 | } 18 | selmon->sel = c; 19 | + if (selmon->lt[selmon->sellt]->arrange == monocle) 20 | + arrangemon(selmon); 21 | drawbars(); 22 | } 23 | 24 | @@ -1123,8 +1125,15 @@ monocle(Monitor *m) 25 | n++; 26 | if (n > 0) /* override layout symbol */ 27 | snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); 28 | - for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) 29 | + for (c = m->stack; c && (!ISVISIBLE(c) || c->isfloating); c = c->snext); 30 | + if (c && !c->isfloating) { 31 | + XMoveWindow(dpy, c->win, m->wx, m->wy); 32 | resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); 33 | + c = c->snext; 34 | + } 35 | + for (; c; c = c->snext) 36 | + if (!c->isfloating && ISVISIBLE(c)) 37 | + XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y); 38 | } 39 | 40 | void 41 | -- 42 | 2.45.2 43 | 44 | -------------------------------------------------------------------------------- /dwm/dwm-autostart-6.2.diff: -------------------------------------------------------------------------------- 1 | From 191c3a690ecfaf09708a2843e3a4682e8d8aa59c Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 24 Jun 2024 09:55:15 +0200 4 | Subject: [PATCH] Adding autostart patch 5 | 6 | Refer to https://dwm.suckless.org/patches/autostart/ 7 | --- 8 | dwm.c | 13 +++++++++++++ 9 | 1 file changed, 13 insertions(+) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index 4465af1..e634dc1 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -193,6 +193,7 @@ static void resizeclient(Client *c, int x, int y, int w, int h); 16 | static void resizemouse(const Arg *arg); 17 | static void restack(Monitor *m); 18 | static void run(void); 19 | +static void runAutostart(void); 20 | static void scan(void); 21 | static int sendevent(Client *c, Atom proto); 22 | static void sendmon(Client *c, Monitor *m); 23 | @@ -1380,6 +1381,17 @@ run(void) 24 | handler[ev.type](&ev); /* call handler */ 25 | } 26 | 27 | +void 28 | +runAutostart(void) { 29 | + 30 | + int ret; 31 | + 32 | + ret = system("cd ~/.config/dwm; ./autostart_blocking.sh"); 33 | + ret = system("cd ~/.config/dwm; ./autostart.sh &"); 34 | + 35 | + if (ret); // ignore, hide compilation warnings 36 | +} 37 | + 38 | void 39 | scan(void) 40 | { 41 | @@ -2142,6 +2154,7 @@ main(int argc, char *argv[]) 42 | die("pledge"); 43 | #endif /* __OpenBSD__ */ 44 | scan(); 45 | + runAutostart(); 46 | run(); 47 | cleanup(); 48 | XCloseDisplay(dpy); 49 | -- 50 | 2.45.2 51 | 52 | -------------------------------------------------------------------------------- /dwm/dwm-autostart-6.3.diff: -------------------------------------------------------------------------------- 1 | From 788b6667e121ad234fb8dab6c5ab962b0dd9d8c4 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 24 Jun 2024 09:55:42 +0200 4 | Subject: [PATCH] Adding autostart patch 5 | 6 | Refer to https://dwm.suckless.org/patches/autostart/ 7 | --- 8 | dwm.c | 13 +++++++++++++ 9 | 1 file changed, 13 insertions(+) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index a96f33c..0fad144 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -194,6 +194,7 @@ static void resizeclient(Client *c, int x, int y, int w, int h); 16 | static void resizemouse(const Arg *arg); 17 | static void restack(Monitor *m); 18 | static void run(void); 19 | +static void runAutostart(void); 20 | static void scan(void); 21 | static int sendevent(Client *c, Atom proto); 22 | static void sendmon(Client *c, Monitor *m); 23 | @@ -1384,6 +1385,17 @@ run(void) 24 | handler[ev.type](&ev); /* call handler */ 25 | } 26 | 27 | +void 28 | +runAutostart(void) { 29 | + 30 | + int ret; 31 | + 32 | + ret = system("cd ~/.config/dwm; ./autostart_blocking.sh"); 33 | + ret = system("cd ~/.config/dwm; ./autostart.sh &"); 34 | + 35 | + if (ret); // ignore, hide compilation warnings 36 | +} 37 | + 38 | void 39 | scan(void) 40 | { 41 | @@ -2148,6 +2160,7 @@ main(int argc, char *argv[]) 42 | die("pledge"); 43 | #endif /* __OpenBSD__ */ 44 | scan(); 45 | + runAutostart(); 46 | run(); 47 | cleanup(); 48 | XCloseDisplay(dpy); 49 | -- 50 | 2.45.2 51 | 52 | -------------------------------------------------------------------------------- /st/st-no_window_decorations-0.8.5-20220824-72fd327.diff: -------------------------------------------------------------------------------- 1 | From abd444fde0fc6c6d4c297a55110e7eeb64a2661d Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 24 Aug 2022 11:10:59 +0200 4 | Subject: [PATCH] Adding no window decorations patch 5 | 6 | This patch sets the _MOTIF_WM_HINTS property on the st window which 7 | will allow the window to be drawn without window decorations if the 8 | window manager supports it. 9 | 10 | In GNOME and KDE this should allow the window to be drawn without a 11 | title bar at the top. 12 | 13 | In dwm if the decoration hints patch is applied then the st window 14 | should start without a window border. 15 | --- 16 | x.c | 5 +++++ 17 | 1 file changed, 5 insertions(+) 18 | 19 | diff --git a/x.c b/x.c 20 | index 2a3bd38..37d893f 100644 21 | --- a/x.c 22 | +++ b/x.c 23 | @@ -1220,6 +1220,11 @@ xinit(int cols, int rows) 24 | xw.netwmiconname = XInternAtom(xw.dpy, "_NET_WM_ICON_NAME", False); 25 | XSetWMProtocols(xw.dpy, xw.win, &xw.wmdeletewin, 1); 26 | 27 | + Atom motifwmhints = XInternAtom(xw.dpy, "_MOTIF_WM_HINTS", False); 28 | + unsigned int data[] = { 0x2, 0x0, 0x0, 0x0, 0x0 }; 29 | + XChangeProperty(xw.dpy, xw.win, motifwmhints, motifwmhints, 16, 30 | + PropModeReplace, (unsigned char *)data, 5); 31 | + 32 | xw.netwmpid = XInternAtom(xw.dpy, "_NET_WM_PID", False); 33 | XChangeProperty(xw.dpy, xw.win, xw.netwmpid, XA_CARDINAL, 32, 34 | PropModeReplace, (uchar *)&thispid, 1); 35 | -- 36 | 2.37.2 37 | 38 | -------------------------------------------------------------------------------- /dwm/dwm-use_a_different_font_for_the_status-6.2.diff: -------------------------------------------------------------------------------- 1 | From 66b6a10d104157dfa0b223e462995d909bdca059 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:38:55 +0200 4 | Subject: [PATCH] Use a different font for the status 5 | 6 | This is meant as an example patch (horrible hack) to use a 7 | different font for the status compared to the rest of the bar. 8 | 9 | The gist of it is that we forcibly use the second, or third, font to 10 | draw the bar, leaving the primary (first) font to draw the rest. 11 | --- 12 | dwm.c | 4 ++++ 13 | 1 file changed, 4 insertions(+) 14 | 15 | diff --git a/dwm.c b/dwm.c 16 | index 4465af1..5e99aca 100644 17 | --- a/dwm.c 18 | +++ b/dwm.c 19 | @@ -700,12 +700,16 @@ drawbar(Monitor *m) 20 | int boxw = drw->fonts->h / 6 + 2; 21 | unsigned int i, occ = 0, urg = 0; 22 | Client *c; 23 | + Fnt *cur; 24 | 25 | /* draw status first so it can be overdrawn by tags later */ 26 | if (m == selmon) { /* status is only drawn on selected monitor */ 27 | + cur = drw->fonts; // remember which was the first font 28 | + drw->fonts = drw->fonts->next; // skip to the second font, add more of these to get to third, fourth etc. 29 | drw_setscheme(drw, scheme[SchemeNorm]); 30 | sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ 31 | drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0); 32 | + drw->fonts = cur; // set the normal font back to the first font 33 | } 34 | 35 | for (c = m->clients; c; c = c->next) { 36 | -- 37 | 2.45.2 38 | 39 | -------------------------------------------------------------------------------- /dwm/dwm-desktop-6.2.diff: -------------------------------------------------------------------------------- 1 | From 31bfeba5a8993201bddf8736f0e236c3d5273384 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 09:46:49 +0200 4 | Subject: [PATCH] Adding desktop patch 5 | 6 | --- 7 | dwm.c | 15 ++++++++++----- 8 | 1 file changed, 10 insertions(+), 5 deletions(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index 4465af1..328540d 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -1737,12 +1737,14 @@ toggletag(const Arg *arg) 15 | void 16 | toggleview(const Arg *arg) 17 | { 18 | + Monitor *m; 19 | unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK); 20 | 21 | if (newtagset) { 22 | - selmon->tagset[selmon->seltags] = newtagset; 23 | + for (m = mons; m; m = m->next) 24 | + m->tagset[m->seltags] = newtagset; 25 | focus(NULL); 26 | - arrange(selmon); 27 | + arrange(NULL); 28 | } 29 | } 30 | 31 | @@ -2035,13 +2037,16 @@ updatewmhints(Client *c) 32 | void 33 | view(const Arg *arg) 34 | { 35 | + Monitor *m; 36 | if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) 37 | return; 38 | - selmon->seltags ^= 1; /* toggle sel tagset */ 39 | + for (m = mons; m; m = m->next) 40 | + m->seltags ^= 1; /* toggle sel tagset */ 41 | if (arg->ui & TAGMASK) 42 | - selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; 43 | + for (m = mons; m; m = m->next) 44 | + m->tagset[m->seltags] = arg->ui & TAGMASK; 45 | focus(NULL); 46 | - arrange(selmon); 47 | + arrange(NULL); 48 | } 49 | 50 | Client * 51 | -- 52 | 2.45.2 53 | 54 | -------------------------------------------------------------------------------- /dwm/dwm-desktop-6.3.diff: -------------------------------------------------------------------------------- 1 | From 70c0d1b4e4fc2b9df1c313c23cf5aea7a396688f Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 09:47:03 +0200 4 | Subject: [PATCH] Adding desktop patch 5 | 6 | --- 7 | dwm.c | 15 ++++++++++----- 8 | 1 file changed, 10 insertions(+), 5 deletions(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index a96f33c..5c76f0b 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -1743,12 +1743,14 @@ toggletag(const Arg *arg) 15 | void 16 | toggleview(const Arg *arg) 17 | { 18 | + Monitor *m; 19 | unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK); 20 | 21 | if (newtagset) { 22 | - selmon->tagset[selmon->seltags] = newtagset; 23 | + for (m = mons; m; m = m->next) 24 | + m->tagset[m->seltags] = newtagset; 25 | focus(NULL); 26 | - arrange(selmon); 27 | + arrange(NULL); 28 | } 29 | } 30 | 31 | @@ -2041,13 +2043,16 @@ updatewmhints(Client *c) 32 | void 33 | view(const Arg *arg) 34 | { 35 | + Monitor *m; 36 | if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) 37 | return; 38 | - selmon->seltags ^= 1; /* toggle sel tagset */ 39 | + for (m = mons; m; m = m->next) 40 | + m->seltags ^= 1; /* toggle sel tagset */ 41 | if (arg->ui & TAGMASK) 42 | - selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; 43 | + for (m = mons; m; m = m->next) 44 | + m->tagset[m->seltags] = arg->ui & TAGMASK; 45 | focus(NULL); 46 | - arrange(selmon); 47 | + arrange(NULL); 48 | } 49 | 50 | Client * 51 | -- 52 | 2.45.2 53 | 54 | -------------------------------------------------------------------------------- /dwm/dwm-use_a_different_font_for_the_status-6.3.diff: -------------------------------------------------------------------------------- 1 | From f152b628fdc77a2438bf25a161a7992c1a96ab2b Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:40:38 +0200 4 | Subject: [PATCH] Use a different font for the status 5 | 6 | This is meant as an example patch (horrible hack) to use a 7 | different font for the status compared to the rest of the bar. 8 | 9 | The gist of it is that we forcibly use the second, or third, font to 10 | draw the bar, leaving the primary (first) font to draw the rest. 11 | --- 12 | dwm.c | 4 ++++ 13 | 1 file changed, 4 insertions(+) 14 | 15 | diff --git a/dwm.c b/dwm.c 16 | index a96f33c..87497af 100644 17 | --- a/dwm.c 18 | +++ b/dwm.c 19 | @@ -701,15 +701,19 @@ drawbar(Monitor *m) 20 | int boxw = drw->fonts->h / 6 + 2; 21 | unsigned int i, occ = 0, urg = 0; 22 | Client *c; 23 | + Fnt *cur; 24 | 25 | if (!m->showbar) 26 | return; 27 | 28 | /* draw status first so it can be overdrawn by tags later */ 29 | if (m == selmon) { /* status is only drawn on selected monitor */ 30 | + cur = drw->fonts; // remember which was the first font 31 | + drw->fonts = drw->fonts->next; // skip to the second font, add more of these to get to third, fourth etc. 32 | drw_setscheme(drw, scheme[SchemeNorm]); 33 | tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ 34 | drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0); 35 | + drw->fonts = cur; // set the normal font back to the first font 36 | } 37 | 38 | for (c = m->clients; c; c = c->next) { 39 | -- 40 | 2.45.2 41 | 42 | -------------------------------------------------------------------------------- /tabbed/tabbed-bottomtabs-0.6-20200512-dabf6a2.diff: -------------------------------------------------------------------------------- 1 | From 3c5f53d4e674c5f9c4077722f0c04688f8be1127 Mon Sep 17 00:00:00 2001 2 | From: bakkeby 3 | Date: Mon, 26 Jul 2021 11:09:49 +0200 4 | Subject: [PATCH] Adding bottom tabs patch 5 | 6 | --- 7 | tabbed.c | 8 ++++---- 8 | 1 file changed, 4 insertions(+), 4 deletions(-) 9 | 10 | diff --git a/tabbed.c b/tabbed.c 11 | index eafe28a..7fcd53c 100644 12 | --- a/tabbed.c 13 | +++ b/tabbed.c 14 | @@ -182,7 +182,7 @@ buttonpress(const XEvent *e) 15 | int i, fc; 16 | Arg arg; 17 | 18 | - if (ev->y < 0 || ev->y > bh) 19 | + if (ev->y < wh - bh) 20 | return; 21 | 22 | if (((fc = getfirsttab()) > 0 && ev->x < TEXTW(before)) || ev->x < 0) 23 | @@ -332,7 +332,7 @@ drawbar(void) 24 | dc.w = ww; 25 | XFetchName(dpy, win, &name); 26 | drawtext(name ? name : "", dc.norm); 27 | - XCopyArea(dpy, dc.drawable, win, dc.gc, 0, 0, ww, bh, 0, 0); 28 | + XCopyArea(dpy, dc.drawable, win, dc.gc, 0, 0, ww, bh, 0, wh - bh); 29 | XSync(dpy, False); 30 | 31 | return; 32 | @@ -371,7 +371,7 @@ drawbar(void) 33 | dc.x += dc.w; 34 | clients[c]->tabx = dc.x; 35 | } 36 | - XCopyArea(dpy, dc.drawable, win, dc.gc, 0, 0, ww, bh, 0, 0); 37 | + XCopyArea(dpy, dc.drawable, win, dc.gc, 0, 0, ww, bh, 0, wh - bh); 38 | XSync(dpy, False); 39 | } 40 | 41 | @@ -881,7 +881,7 @@ resize(int c, int w, int h) 42 | XWindowChanges wc; 43 | 44 | ce.x = 0; 45 | - ce.y = wc.y = bh; 46 | + ce.y = wc.y = 0; 47 | ce.width = wc.width = w; 48 | ce.height = wc.height = h; 49 | ce.type = ConfigureNotify; 50 | -- 51 | 2.45.2 52 | 53 | -------------------------------------------------------------------------------- /st/st-anysize-simple-0.9-20230207-211964d.diff: -------------------------------------------------------------------------------- 1 | From a6dd2f762b34b60f6df77acdd686fbedaf637412 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 12 Jun 2023 17:16:53 +0200 4 | Subject: [PATCH] Anysize patch - simple version 5 | 6 | The original anysize patch is fairly invasive and makes a lot of changes 7 | to the st code base. 8 | 9 | Out of these changes there are only two lines that allow for the window to 10 | be resized to any size and that is setting the height and width increment 11 | size hints to 1. 12 | 13 | The rest of the changes are all related to centering the terminal content 14 | within the window frame by distributing leftover pixels on the horizontal 15 | and vertical borders. 16 | 17 | This has the side effect of the terminal content wobbling when resizing it 18 | diagonally. 19 | 20 | This simple anysize version only applies the size hint changes which means 21 | that leftover pixels will remain on the right and bottom sides of the 22 | terminal. 23 | --- 24 | x.c | 4 ++-- 25 | 1 file changed, 2 insertions(+), 2 deletions(-) 26 | 27 | diff --git a/x.c b/x.c 28 | index aa09997..ea6e016 100644 29 | --- a/x.c 30 | +++ b/x.c 31 | @@ -869,8 +869,8 @@ xhints(void) 32 | sizeh->flags = PSize | PResizeInc | PBaseSize | PMinSize; 33 | sizeh->height = win.h; 34 | sizeh->width = win.w; 35 | - sizeh->height_inc = win.ch; 36 | - sizeh->width_inc = win.cw; 37 | + sizeh->height_inc = 1; 38 | + sizeh->width_inc = 1; 39 | sizeh->base_height = 2 * borderpx; 40 | sizeh->base_width = 2 * borderpx; 41 | sizeh->min_height = win.ch + 2 * borderpx; 42 | -- 43 | 2.45.2 44 | 45 | -------------------------------------------------------------------------------- /dwm/dwm-monocle_count-6.3.diff: -------------------------------------------------------------------------------- 1 | From 272fb99e9f1ba34fbbe8412967f5f64c567b12d6 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:37:39 +0200 4 | Subject: [PATCH] monocle_count - prints "[M] [2/3]" layout symbol 5 | 6 | --- 7 | dwm.c | 13 +++++++++++-- 8 | 1 file changed, 11 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index a96f33c..a3094d9 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -700,6 +700,7 @@ drawbar(Monitor *m) 15 | int boxs = drw->fonts->h / 9; 16 | int boxw = drw->fonts->h / 6 + 2; 17 | unsigned int i, occ = 0, urg = 0; 18 | + unsigned int a = 0, s = 0; 19 | Client *c; 20 | 21 | if (!m->showbar) 22 | @@ -728,6 +729,16 @@ drawbar(Monitor *m) 23 | urg & 1 << i); 24 | x += w; 25 | } 26 | + 27 | + if (m->lt[m->sellt]->arrange == monocle) { 28 | + for (c = nexttiled(m->clients), a = 0, s = 0; c; c = nexttiled(c->next), a++) 29 | + if (c == m->stack) 30 | + s = a + 1; 31 | + if (!s && a) 32 | + s = 1; 33 | + snprintf(m->ltsymbol, sizeof m->ltsymbol, "[M] [%d/%d]", s, a); 34 | + } 35 | + 36 | w = blw = TEXTW(m->ltsymbol); 37 | drw_setscheme(drw, scheme[SchemeNorm]); 38 | x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); 39 | @@ -1113,8 +1124,6 @@ monocle(Monitor *m) 40 | for (c = m->clients; c; c = c->next) 41 | if (ISVISIBLE(c)) 42 | n++; 43 | - if (n > 0) /* override layout symbol */ 44 | - snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); 45 | for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) 46 | resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); 47 | } 48 | -- 49 | 2.45.2 50 | 51 | -------------------------------------------------------------------------------- /dwm/dwm-fullscreen-compilation-rule-6.2.diff: -------------------------------------------------------------------------------- 1 | From c05eeaad8101522756d533510d5129972740e9ab Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:16:15 +0200 4 | Subject: [PATCH 2/2] Adding fake fullscreen client rule 5 | 6 | --- 7 | config.def.h | 6 +++--- 8 | dwm.c | 2 ++ 9 | 2 files changed, 5 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/config.def.h b/config.def.h 12 | index 5f28f2c..dd98367 100644 13 | --- a/config.def.h 14 | +++ b/config.def.h 15 | @@ -26,9 +26,9 @@ static const Rule rules[] = { 16 | * WM_CLASS(STRING) = instance, class 17 | * WM_NAME(STRING) = title 18 | */ 19 | - /* class instance title tags mask isfloating monitor */ 20 | - { "Gimp", NULL, NULL, 0, 1, -1 }, 21 | - { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, 22 | + /* class instance title tags mask isfloating isfakefullscreen monitor */ 23 | + { "Gimp", NULL, NULL, 0, 1, 0, -1 }, 24 | + { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1 }, 25 | }; 26 | 27 | /* layout(s) */ 28 | diff --git a/dwm.c b/dwm.c 29 | index 763c224..c62a02b 100644 30 | --- a/dwm.c 31 | +++ b/dwm.c 32 | @@ -139,6 +139,7 @@ typedef struct { 33 | const char *title; 34 | unsigned int tags; 35 | int isfloating; 36 | + int isfakefullscreen; 37 | int monitor; 38 | } Rule; 39 | 40 | @@ -303,6 +304,7 @@ applyrules(Client *c) 41 | { 42 | c->isfloating = r->isfloating; 43 | c->tags |= r->tags; 44 | + c->fakefullscreen = r->isfakefullscreen; 45 | for (m = mons; m && m->num != r->monitor; m = m->next); 46 | if (m) 47 | c->mon = m; 48 | -- 49 | 2.45.2 50 | 51 | -------------------------------------------------------------------------------- /dwm/dwm-fullscreen-compilation-rule-6.3.diff: -------------------------------------------------------------------------------- 1 | From 54bcd6fbb0536cdd79046b11ffdd124e25260825 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:16:44 +0200 4 | Subject: [PATCH 2/2] Adding fake fullscreen client rule 5 | 6 | --- 7 | config.def.h | 6 +++--- 8 | dwm.c | 2 ++ 9 | 2 files changed, 5 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/config.def.h b/config.def.h 12 | index 5f28f2c..dd98367 100644 13 | --- a/config.def.h 14 | +++ b/config.def.h 15 | @@ -26,9 +26,9 @@ static const Rule rules[] = { 16 | * WM_CLASS(STRING) = instance, class 17 | * WM_NAME(STRING) = title 18 | */ 19 | - /* class instance title tags mask isfloating monitor */ 20 | - { "Gimp", NULL, NULL, 0, 1, -1 }, 21 | - { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, 22 | + /* class instance title tags mask isfloating isfakefullscreen monitor */ 23 | + { "Gimp", NULL, NULL, 0, 1, 0, -1 }, 24 | + { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1 }, 25 | }; 26 | 27 | /* layout(s) */ 28 | diff --git a/dwm.c b/dwm.c 29 | index 53f0bd4..ed2b91b 100644 30 | --- a/dwm.c 31 | +++ b/dwm.c 32 | @@ -139,6 +139,7 @@ typedef struct { 33 | const char *title; 34 | unsigned int tags; 35 | int isfloating; 36 | + int isfakefullscreen; 37 | int monitor; 38 | } Rule; 39 | 40 | @@ -304,6 +305,7 @@ applyrules(Client *c) 41 | { 42 | c->isfloating = r->isfloating; 43 | c->tags |= r->tags; 44 | + c->fakefullscreen = r->isfakefullscreen; 45 | for (m = mons; m && m->num != r->monitor; m = m->next); 46 | if (m) 47 | c->mon = m; 48 | -- 49 | 2.45.2 50 | 51 | -------------------------------------------------------------------------------- /dwm/dwm-spotifyworkaround-6.2.diff: -------------------------------------------------------------------------------- 1 | From 2e9f6f40d4b0deb4a938495cc57067eebc09fb5e Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 23:08:14 +0200 4 | Subject: [PATCH] spotify workaround 5 | 6 | Workaround for programs like spotify which do not offer instance 7 | or class hints when they initially map, resulting in no rules applying 8 | --- 9 | dwm.c | 5 ++++- 10 | 1 file changed, 4 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/dwm.c b/dwm.c 13 | index 4465af1..eb54fd2 100644 14 | --- a/dwm.c 15 | +++ b/dwm.c 16 | @@ -63,7 +63,7 @@ enum { SchemeNorm, SchemeSel }; /* color schemes */ 17 | enum { NetSupported, NetWMName, NetWMState, NetWMCheck, 18 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, 19 | NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ 20 | -enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ 21 | +enum { WMClass, WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ 22 | enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, 23 | ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ 24 | 25 | @@ -1242,6 +1242,8 @@ propertynotify(XEvent *e) 26 | } 27 | if (ev->atom == netatom[NetWMWindowType]) 28 | updatewindowtype(c); 29 | + if (ev->atom == wmatom[WMClass]) 30 | + applyrules(c); 31 | } 32 | } 33 | 34 | @@ -1549,6 +1551,7 @@ setup(void) 35 | updategeom(); 36 | /* init atoms */ 37 | utf8string = XInternAtom(dpy, "UTF8_STRING", False); 38 | + wmatom[WMClass] = XInternAtom(dpy, "WM_CLASS", False); 39 | wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); 40 | wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); 41 | wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); 42 | -- 43 | 2.45.2 44 | 45 | -------------------------------------------------------------------------------- /dwm/dwm-spotifyworkaround-6.3.diff: -------------------------------------------------------------------------------- 1 | From fa5a7aca06f67bff1e1d7c4279db1ec77685a787 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 23:08:35 +0200 4 | Subject: [PATCH] spotify workaround 5 | 6 | Workaround for programs like spotify which do not offer instance 7 | or class hints when they initially map, resulting in no rules applying 8 | --- 9 | dwm.c | 5 ++++- 10 | 1 file changed, 4 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/dwm.c b/dwm.c 13 | index a96f33c..51f4900 100644 14 | --- a/dwm.c 15 | +++ b/dwm.c 16 | @@ -63,7 +63,7 @@ enum { SchemeNorm, SchemeSel }; /* color schemes */ 17 | enum { NetSupported, NetWMName, NetWMState, NetWMCheck, 18 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, 19 | NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ 20 | -enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ 21 | +enum { WMClass, WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ 22 | enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, 23 | ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ 24 | 25 | @@ -1246,6 +1246,8 @@ propertynotify(XEvent *e) 26 | } 27 | if (ev->atom == netatom[NetWMWindowType]) 28 | updatewindowtype(c); 29 | + if (ev->atom == wmatom[WMClass]) 30 | + applyrules(c); 31 | } 32 | } 33 | 34 | @@ -1553,6 +1555,7 @@ setup(void) 35 | updategeom(); 36 | /* init atoms */ 37 | utf8string = XInternAtom(dpy, "UTF8_STRING", False); 38 | + wmatom[WMClass] = XInternAtom(dpy, "WM_CLASS", False); 39 | wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); 40 | wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); 41 | wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); 42 | -- 43 | 2.45.2 44 | 45 | -------------------------------------------------------------------------------- /dwm/dwm-losefullscreen-6.2.diff: -------------------------------------------------------------------------------- 1 | From 8cd662099852fcd903b2ae3ed9f8085eb7201c10 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:33:28 +0200 4 | Subject: [PATCH] Lose fullscreen on focus change 5 | 6 | --- 7 | dwm.c | 15 ++++++++++++++- 8 | 1 file changed, 14 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index 4465af1..277eb48 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -177,6 +177,7 @@ static void grabkeys(void); 15 | static void incnmaster(const Arg *arg); 16 | static void keypress(XEvent *e); 17 | static void killclient(const Arg *arg); 18 | +static void losefullscreen(Client *sel, Client *next); 19 | static void manage(Window w, XWindowAttributes *wa); 20 | static void mappingnotify(XEvent *e); 21 | static void maprequest(XEvent *e); 22 | @@ -850,6 +851,7 @@ focusstack(const Arg *arg) 23 | c = i; 24 | } 25 | if (c) { 26 | + losefullscreen(selmon->sel, c); 27 | focus(c); 28 | restack(selmon); 29 | } 30 | @@ -1014,6 +1016,15 @@ killclient(const Arg *arg) 31 | } 32 | } 33 | 34 | +void 35 | +losefullscreen(Client *sel, Client *next) 36 | +{ 37 | + if (!sel || !next) 38 | + return; 39 | + if (sel->isfullscreen && ISVISIBLE(sel) && sel->mon == next->mon && !next->isfloating) 40 | + setfullscreen(sel, 0); 41 | +} 42 | + 43 | void 44 | manage(Window w, XWindowAttributes *wa) 45 | { 46 | @@ -1068,8 +1079,10 @@ manage(Window w, XWindowAttributes *wa) 47 | (unsigned char *) &(c->win), 1); 48 | XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ 49 | setclientstate(c, NormalState); 50 | - if (c->mon == selmon) 51 | + if (c->mon == selmon) { 52 | + losefullscreen(selmon->sel, c); 53 | unfocus(selmon->sel, 0); 54 | + } 55 | c->mon->sel = c; 56 | arrange(c->mon); 57 | XMapWindow(dpy, c->win); 58 | -- 59 | 2.45.2 60 | 61 | -------------------------------------------------------------------------------- /dwm/dwm-losefullscreen-6.3.diff: -------------------------------------------------------------------------------- 1 | From 1046d409eb9b67245a7851ed18028c1e404cacdf Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:33:48 +0200 4 | Subject: [PATCH] Lose fullscreen on focus change 5 | 6 | --- 7 | dwm.c | 15 ++++++++++++++- 8 | 1 file changed, 14 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index a96f33c..2964adb 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -178,6 +178,7 @@ static void grabkeys(void); 15 | static void incnmaster(const Arg *arg); 16 | static void keypress(XEvent *e); 17 | static void killclient(const Arg *arg); 18 | +static void losefullscreen(Client *sel, Client *next); 19 | static void manage(Window w, XWindowAttributes *wa); 20 | static void mappingnotify(XEvent *e); 21 | static void maprequest(XEvent *e); 22 | @@ -854,6 +855,7 @@ focusstack(const Arg *arg) 23 | c = i; 24 | } 25 | if (c) { 26 | + losefullscreen(selmon->sel, c); 27 | focus(c); 28 | restack(selmon); 29 | } 30 | @@ -1018,6 +1020,15 @@ killclient(const Arg *arg) 31 | } 32 | } 33 | 34 | +void 35 | +losefullscreen(Client *sel, Client *next) 36 | +{ 37 | + if (!sel || !next) 38 | + return; 39 | + if (sel->isfullscreen && ISVISIBLE(sel) && sel->mon == next->mon && !next->isfloating) 40 | + setfullscreen(sel, 0); 41 | +} 42 | + 43 | void 44 | manage(Window w, XWindowAttributes *wa) 45 | { 46 | @@ -1072,8 +1083,10 @@ manage(Window w, XWindowAttributes *wa) 47 | (unsigned char *) &(c->win), 1); 48 | XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ 49 | setclientstate(c, NormalState); 50 | - if (c->mon == selmon) 51 | + if (c->mon == selmon) { 52 | + losefullscreen(selmon->sel, c); 53 | unfocus(selmon->sel, 0); 54 | + } 55 | c->mon->sel = c; 56 | arrange(c->mon); 57 | XMapWindow(dpy, c->win); 58 | -- 59 | 2.45.2 60 | 61 | -------------------------------------------------------------------------------- /dwm/dwm-losefullscreen-6.5.diff: -------------------------------------------------------------------------------- 1 | From 71ab838c63a9d8c7f72b7e79c1e405fee7718c5f Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:33:48 +0200 4 | Subject: [PATCH] Lose fullscreen on focus change 5 | 6 | --- 7 | dwm.c | 15 ++++++++++++++- 8 | 1 file changed, 14 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index f1d86b2..27b2897 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -178,6 +178,7 @@ static void grabkeys(void); 15 | static void incnmaster(const Arg *arg); 16 | static void keypress(XEvent *e); 17 | static void killclient(const Arg *arg); 18 | +static void losefullscreen(Client *sel, Client *next); 19 | static void manage(Window w, XWindowAttributes *wa); 20 | static void mappingnotify(XEvent *e); 21 | static void maprequest(XEvent *e); 22 | @@ -856,6 +857,7 @@ focusstack(const Arg *arg) 23 | c = i; 24 | } 25 | if (c) { 26 | + losefullscreen(selmon->sel, c); 27 | focus(c); 28 | restack(selmon); 29 | } 30 | @@ -1028,6 +1030,15 @@ killclient(const Arg *arg) 31 | } 32 | } 33 | 34 | +void 35 | +losefullscreen(Client *sel, Client *next) 36 | +{ 37 | + if (!sel || !next) 38 | + return; 39 | + if (sel->isfullscreen && ISVISIBLE(sel) && sel->mon == next->mon && !next->isfloating) 40 | + setfullscreen(sel, 0); 41 | +} 42 | + 43 | void 44 | manage(Window w, XWindowAttributes *wa) 45 | { 46 | @@ -1080,8 +1091,10 @@ manage(Window w, XWindowAttributes *wa) 47 | (unsigned char *) &(c->win), 1); 48 | XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ 49 | setclientstate(c, NormalState); 50 | - if (c->mon == selmon) 51 | + if (c->mon == selmon) { 52 | + losefullscreen(selmon->sel, c); 53 | unfocus(selmon->sel, 0); 54 | + } 55 | c->mon->sel = c; 56 | arrange(c->mon); 57 | XMapWindow(dpy, c->win); 58 | -- 59 | 2.45.2 60 | 61 | -------------------------------------------------------------------------------- /dwm/dwm-losefullscreen-6.6.diff: -------------------------------------------------------------------------------- 1 | From 010347076e47dc6826aedc21e8375223a6dbd2f4 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:33:48 +0200 4 | Subject: [PATCH] Lose fullscreen on focus change 5 | 6 | --- 7 | dwm.c | 15 ++++++++++++++- 8 | 1 file changed, 14 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index 1443802..96b1ba1 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -177,6 +177,7 @@ static void grabkeys(void); 15 | static void incnmaster(const Arg *arg); 16 | static void keypress(XEvent *e); 17 | static void killclient(const Arg *arg); 18 | +static void losefullscreen(Client *sel, Client *next); 19 | static void manage(Window w, XWindowAttributes *wa); 20 | static void mappingnotify(XEvent *e); 21 | static void maprequest(XEvent *e); 22 | @@ -855,6 +856,7 @@ focusstack(const Arg *arg) 23 | c = i; 24 | } 25 | if (c) { 26 | + losefullscreen(selmon->sel, c); 27 | focus(c); 28 | restack(selmon); 29 | } 30 | @@ -1027,6 +1029,15 @@ killclient(const Arg *arg) 31 | } 32 | } 33 | 34 | +void 35 | +losefullscreen(Client *sel, Client *next) 36 | +{ 37 | + if (!sel || !next) 38 | + return; 39 | + if (sel->isfullscreen && ISVISIBLE(sel) && sel->mon == next->mon && !next->isfloating) 40 | + setfullscreen(sel, 0); 41 | +} 42 | + 43 | void 44 | manage(Window w, XWindowAttributes *wa) 45 | { 46 | @@ -1079,8 +1090,10 @@ manage(Window w, XWindowAttributes *wa) 47 | (unsigned char *) &(c->win), 1); 48 | XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ 49 | setclientstate(c, NormalState); 50 | - if (c->mon == selmon) 51 | + if (c->mon == selmon) { 52 | + losefullscreen(selmon->sel, c); 53 | unfocus(selmon->sel, 0); 54 | + } 55 | c->mon->sel = c; 56 | arrange(c->mon); 57 | XMapWindow(dpy, c->win); 58 | -- 59 | 2.50.1 60 | 61 | -------------------------------------------------------------------------------- /dwm/dwm-tabbed_fickering_after_xdotool_windowreparent_workaround-6.3.diff: -------------------------------------------------------------------------------- 1 | From 76ae3926b9c223a8000fc062141a979ede338749 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 9 Feb 2022 10:14:37 +0100 4 | Subject: [PATCH] Fixes flickering in tabbed after reparenting a window in dwm 5 | 6 | This is a workaround ref. 7 | https://www.reddit.com/r/suckless/comments/sisbe2/adding_an_existing_window_to_tabbed_causes/ 8 | 9 | The scenario is that you run tabbed and then you use xdotool to 10 | reparent an existing client window into tabbed then that window 11 | will start flickering when it has focus. 12 | 13 | This has to do with that both dwm and tabbed will receive FocusIn 14 | events resulting in an endless loop where tabbed sets focus to the 15 | tabbed window whereas dwm will set the focus back to tabbed itself. 16 | 17 | To replicate: 18 | - start two terminals and tabbed 19 | - run xwininfo on tabbed to get its window ID (e.g. 0xe00003) 20 | - now run the following command and select the other terminal 21 | 22 | xdotool windowreparent $(xdotool selectwindow) 0xe00003 23 | 24 | The other terminal should be placed within tabbed as expected, but 25 | it should flicker and CPU usage should go up. 26 | 27 | The workaround is to have dwm ignore the FocusIn event if the window 28 | that the event is related to is not managed by the window manager. 29 | --- 30 | dwm.c | 2 +- 31 | 1 file changed, 1 insertion(+), 1 deletion(-) 32 | 33 | diff --git a/dwm.c b/dwm.c 34 | index a96f33c..f625ef3 100644 35 | --- a/dwm.c 36 | +++ b/dwm.c 37 | @@ -815,7 +815,7 @@ focusin(XEvent *e) 38 | { 39 | XFocusChangeEvent *ev = &e->xfocus; 40 | 41 | - if (selmon->sel && ev->window != selmon->sel->win) 42 | + if (selmon->sel && ev->window != selmon->sel->win && wintoclient(ev->window)) 43 | setfocus(selmon->sel); 44 | } 45 | 46 | -- 47 | 2.19.1 48 | 49 | -------------------------------------------------------------------------------- /dwm/dwm-tabbed_flickering_after_xdotool_windowreparent_workaround-6.3.diff: -------------------------------------------------------------------------------- 1 | From 48735caa6bc7230532e899792a444aa22f64e521 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 23:00:39 +0200 4 | Subject: [PATCH] Fixes flickering in tabbed after reparenting a window in dwm 5 | 6 | This is a workaround ref. 7 | https://www.reddit.com/r/suckless/comments/sisbe2/adding_an_existing_window_to_tabbed_causes/ 8 | 9 | The scenario is that you run tabbed and then you use xdotool to 10 | reparent an existing client window into tabbed then that window 11 | will start flickering when it has focus. 12 | 13 | This has to do with that both dwm and tabbed will receive FocusIn 14 | events resulting in an endless loop where tabbed sets focus to the 15 | tabbed window whereas dwm will set the focus back to tabbed itself. 16 | 17 | To replicate: 18 | - start two terminals and tabbed 19 | - run xwininfo on tabbed to get its window ID (e.g. 0xe00003) 20 | - now run the following command and select the other terminal 21 | 22 | xdotool windowreparent $(xdotool selectwindow) 0xe00003 23 | 24 | The other terminal should be placed within tabbed as expected, but 25 | it should flicker and CPU usage should go up. 26 | 27 | The workaround is to have dwm ignore the FocusIn event if the window 28 | that the event is related to is not managed by the window manager. 29 | --- 30 | dwm.c | 2 +- 31 | 1 file changed, 1 insertion(+), 1 deletion(-) 32 | 33 | diff --git a/dwm.c b/dwm.c 34 | index a96f33c..f625ef3 100644 35 | --- a/dwm.c 36 | +++ b/dwm.c 37 | @@ -815,7 +815,7 @@ focusin(XEvent *e) 38 | { 39 | XFocusChangeEvent *ev = &e->xfocus; 40 | 41 | - if (selmon->sel && ev->window != selmon->sel->win) 42 | + if (selmon->sel && ev->window != selmon->sel->win && wintoclient(ev->window)) 43 | setfocus(selmon->sel); 44 | } 45 | 46 | -- 47 | 2.45.2 48 | 49 | -------------------------------------------------------------------------------- /st/st-default_cursor-0.9-20230207-211964d.diff: -------------------------------------------------------------------------------- 1 | From 1080661abe54eb51480a960949309d99f3d3f88d Mon Sep 17 00:00:00 2001 2 | From: bakkeby 3 | Date: Wed, 12 May 2021 09:13:47 +0200 4 | Subject: [PATCH] Make st interpret cursor 0 as the default cursor. 5 | 6 | According to the specification the "Set cursor style 7 | (DECSCUSR), VT520." escape sequences define both values of 0 and 1 as a blinking block, 8 | with 1 being the default. 9 | 10 | Refer to: 11 | https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-SP-q.1D81 12 | 13 | This patch allows the default cursor to be set when value 0 is used, as opposed to 14 | setting the cursor to a blinking block. 15 | 16 | This allows a command like this to restore the cursor to what st is configured with: 17 | $ echo -ne "\e[ q" 18 | 19 | While many terminal emulators do this it is not adhering to specification. xterm is an 20 | example terminal that sets a blinking block instead of the configured one, same as st. 21 | 22 | Example use case is changing cursor shape in vim depending on what mode is used: 23 | 24 | https://vim.fandom.com/wiki/Change_cursor_shape_in_different_modes 25 | https://askubuntu.com/questions/42663/how-to-make-cursor-change-from-thin-line-to-block-based-on-normal-or-insert-mode 26 | 27 | The alternative in this case would be to explicitly set the cursor back to what you expect 28 | it to be (underline, bar) in the vim configuration. 29 | --- 30 | x.c | 2 +- 31 | 1 file changed, 1 insertion(+), 1 deletion(-) 32 | 33 | diff --git a/x.c b/x.c 34 | index aa09997..f569bb1 100644 35 | --- a/x.c 36 | +++ b/x.c 37 | @@ -1739,7 +1739,7 @@ xsetcursor(int cursor) 38 | { 39 | if (!BETWEEN(cursor, 0, 7)) /* 7: st extension */ 40 | return 1; 41 | - win.cursor = cursor; 42 | + win.cursor = (cursor ? cursor : cursorshape); 43 | return 0; 44 | } 45 | 46 | -- 47 | 2.45.2 48 | 49 | -------------------------------------------------------------------------------- /dwm/dwm-togglefullscreen-6.2.diff: -------------------------------------------------------------------------------- 1 | From 632190a65901831e17dfcbc4f9df18b44b6e2f4d Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:50:21 +0200 4 | Subject: [PATCH] togglefullscreen patch 5 | 6 | Allows you to toggle fullscreen on and off using the same shortcut key. 7 | --- 8 | config.def.h | 1 + 9 | dwm.c | 9 +++++++++ 10 | 2 files changed, 10 insertions(+) 11 | 12 | diff --git a/config.def.h b/config.def.h 13 | index 1c0b587..666d0c4 100644 14 | --- a/config.def.h 15 | +++ b/config.def.h 16 | @@ -78,6 +78,7 @@ static Key keys[] = { 17 | { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, 18 | { MODKEY, XK_space, setlayout, {0} }, 19 | { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 20 | + { MODKEY, XK_y, togglefullscreen, {0} }, 21 | { MODKEY, XK_0, view, {.ui = ~0 } }, 22 | { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 23 | { MODKEY, XK_comma, focusmon, {.i = -1 } }, 24 | diff --git a/dwm.c b/dwm.c 25 | index 4465af1..bcc6ce2 100644 26 | --- a/dwm.c 27 | +++ b/dwm.c 28 | @@ -211,6 +211,7 @@ static void tagmon(const Arg *arg); 29 | static void tile(Monitor *); 30 | static void togglebar(const Arg *arg); 31 | static void togglefloating(const Arg *arg); 32 | +static void togglefullscreen(const Arg *arg); 33 | static void toggletag(const Arg *arg); 34 | static void toggleview(const Arg *arg); 35 | static void unfocus(Client *c, int setfocus); 36 | @@ -1719,6 +1720,14 @@ togglefloating(const Arg *arg) 37 | arrange(selmon); 38 | } 39 | 40 | +void 41 | +togglefullscreen(const Arg *arg) { 42 | + if (!selmon->sel) 43 | + return; 44 | + 45 | + setfullscreen(selmon->sel, !selmon->sel->isfullscreen); 46 | +} 47 | + 48 | void 49 | toggletag(const Arg *arg) 50 | { 51 | -- 52 | 2.45.2 53 | 54 | -------------------------------------------------------------------------------- /dwm/dwm-togglefullscreen-6.3.diff: -------------------------------------------------------------------------------- 1 | From 562316ddbe4bf0e61ab9eec15596f649b76fb9e2 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:50:34 +0200 4 | Subject: [PATCH] togglefullscreen patch 5 | 6 | Allows you to toggle fullscreen on and off using the same shortcut key. 7 | --- 8 | config.def.h | 1 + 9 | dwm.c | 9 +++++++++ 10 | 2 files changed, 10 insertions(+) 11 | 12 | diff --git a/config.def.h b/config.def.h 13 | index a2ac963..bebb0fb 100644 14 | --- a/config.def.h 15 | +++ b/config.def.h 16 | @@ -79,6 +79,7 @@ static Key keys[] = { 17 | { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, 18 | { MODKEY, XK_space, setlayout, {0} }, 19 | { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 20 | + { MODKEY, XK_y, togglefullscreen, {0} }, 21 | { MODKEY, XK_0, view, {.ui = ~0 } }, 22 | { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 23 | { MODKEY, XK_comma, focusmon, {.i = -1 } }, 24 | diff --git a/dwm.c b/dwm.c 25 | index a96f33c..897797f 100644 26 | --- a/dwm.c 27 | +++ b/dwm.c 28 | @@ -212,6 +212,7 @@ static void tagmon(const Arg *arg); 29 | static void tile(Monitor *); 30 | static void togglebar(const Arg *arg); 31 | static void togglefloating(const Arg *arg); 32 | +static void togglefullscreen(const Arg *arg); 33 | static void toggletag(const Arg *arg); 34 | static void toggleview(const Arg *arg); 35 | static void unfocus(Client *c, int setfocus); 36 | @@ -1725,6 +1726,14 @@ togglefloating(const Arg *arg) 37 | arrange(selmon); 38 | } 39 | 40 | +void 41 | +togglefullscreen(const Arg *arg) { 42 | + if (!selmon->sel) 43 | + return; 44 | + 45 | + setfullscreen(selmon->sel, !selmon->sel->isfullscreen); 46 | +} 47 | + 48 | void 49 | toggletag(const Arg *arg) 50 | { 51 | -- 52 | 2.45.2 53 | 54 | -------------------------------------------------------------------------------- /dwm/dwm-savefloats-6.2.diff: -------------------------------------------------------------------------------- 1 | From 02187dd92feef9edba24bf9748cf962e5eff77d5 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Thu, 27 Jun 2024 17:54:59 +0200 4 | Subject: [PATCH] Savefloats, saves size and position of floating windows 5 | 6 | Refer to https://dwm.suckless.org/patches/save_floats/ 7 | --- 8 | dwm.c | 17 +++++++++++++++-- 9 | 1 file changed, 15 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index 4465af1..96b0b26 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -88,6 +88,7 @@ struct Client { 16 | char name[256]; 17 | float mina, maxa; 18 | int x, y, w, h; 19 | + int sfx, sfy, sfw, sfh; /* stored float geometry, used on mode revert */ 20 | int oldx, oldy, oldw, oldh; 21 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 22 | int bw, oldbw; 23 | @@ -1056,6 +1057,10 @@ manage(Window w, XWindowAttributes *wa) 24 | updatewindowtype(c); 25 | updatesizehints(c); 26 | updatewmhints(c); 27 | + c->sfx = c->x; 28 | + c->sfy = c->y; 29 | + c->sfw = c->w; 30 | + c->sfh = c->h; 31 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 32 | grabbuttons(c, 0); 33 | if (!c->isfloating) 34 | @@ -1714,8 +1719,16 @@ togglefloating(const Arg *arg) 35 | return; 36 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 37 | if (selmon->sel->isfloating) 38 | - resize(selmon->sel, selmon->sel->x, selmon->sel->y, 39 | - selmon->sel->w, selmon->sel->h, 0); 40 | + /* restore last known float dimensions */ 41 | + resize(selmon->sel, selmon->sel->sfx, selmon->sel->sfy, 42 | + selmon->sel->sfw, selmon->sel->sfh, False); 43 | + else { 44 | + /* save last known float dimensions */ 45 | + selmon->sel->sfx = selmon->sel->x; 46 | + selmon->sel->sfy = selmon->sel->y; 47 | + selmon->sel->sfw = selmon->sel->w; 48 | + selmon->sel->sfh = selmon->sel->h; 49 | + } 50 | arrange(selmon); 51 | } 52 | 53 | -- 54 | 2.45.2 55 | 56 | -------------------------------------------------------------------------------- /dwm/dwm-savefloats-6.3.diff: -------------------------------------------------------------------------------- 1 | From 510a5cfc0e7b67d016da0857be5997f2b33d9514 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Thu, 27 Jun 2024 17:55:21 +0200 4 | Subject: [PATCH] Savefloats, saves size and position of floating windows 5 | 6 | Refer to https://dwm.suckless.org/patches/save_floats/ 7 | --- 8 | dwm.c | 17 +++++++++++++++-- 9 | 1 file changed, 15 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index a96f33c..faa3c54 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -88,6 +88,7 @@ struct Client { 16 | char name[256]; 17 | float mina, maxa; 18 | int x, y, w, h; 19 | + int sfx, sfy, sfw, sfh; /* stored float geometry, used on mode revert */ 20 | int oldx, oldy, oldw, oldh; 21 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 22 | int bw, oldbw; 23 | @@ -1060,6 +1061,10 @@ manage(Window w, XWindowAttributes *wa) 24 | updatewindowtype(c); 25 | updatesizehints(c); 26 | updatewmhints(c); 27 | + c->sfx = c->x; 28 | + c->sfy = c->y; 29 | + c->sfw = c->w; 30 | + c->sfh = c->h; 31 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 32 | grabbuttons(c, 0); 33 | if (!c->isfloating) 34 | @@ -1720,8 +1725,16 @@ togglefloating(const Arg *arg) 35 | return; 36 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 37 | if (selmon->sel->isfloating) 38 | - resize(selmon->sel, selmon->sel->x, selmon->sel->y, 39 | - selmon->sel->w, selmon->sel->h, 0); 40 | + /* restore last known float dimensions */ 41 | + resize(selmon->sel, selmon->sel->sfx, selmon->sel->sfy, 42 | + selmon->sel->sfw, selmon->sel->sfh, False); 43 | + else { 44 | + /* save last known float dimensions */ 45 | + selmon->sel->sfx = selmon->sel->x; 46 | + selmon->sel->sfy = selmon->sel->y; 47 | + selmon->sel->sfw = selmon->sel->w; 48 | + selmon->sel->sfh = selmon->sel->h; 49 | + } 50 | arrange(selmon); 51 | } 52 | 53 | -- 54 | 2.45.2 55 | 56 | -------------------------------------------------------------------------------- /dwm/dwm-togglefullscreen-6.5.diff: -------------------------------------------------------------------------------- 1 | From f3ff1b46b78cd5933d1358ba507df040517b8d36 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:50:34 +0200 4 | Subject: [PATCH] togglefullscreen patch 5 | 6 | Allows you to toggle fullscreen on and off using the same shortcut key. 7 | --- 8 | config.def.h | 1 + 9 | dwm.c | 9 +++++++++ 10 | 2 files changed, 10 insertions(+) 11 | 12 | diff --git a/config.def.h b/config.def.h 13 | index 9efa774..aa29b45 100644 14 | --- a/config.def.h 15 | +++ b/config.def.h 16 | @@ -79,6 +79,7 @@ static const Key keys[] = { 17 | { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, 18 | { MODKEY, XK_space, setlayout, {0} }, 19 | { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 20 | + { MODKEY, XK_y, togglefullscreen, {0} }, 21 | { MODKEY, XK_0, view, {.ui = ~0 } }, 22 | { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 23 | { MODKEY, XK_comma, focusmon, {.i = -1 } }, 24 | diff --git a/dwm.c b/dwm.c 25 | index f1d86b2..a3c6fbc 100644 26 | --- a/dwm.c 27 | +++ b/dwm.c 28 | @@ -211,6 +211,7 @@ static void tagmon(const Arg *arg); 29 | static void tile(Monitor *m); 30 | static void togglebar(const Arg *arg); 31 | static void togglefloating(const Arg *arg); 32 | +static void togglefullscreen(const Arg *arg); 33 | static void toggletag(const Arg *arg); 34 | static void toggleview(const Arg *arg); 35 | static void unfocus(Client *c, int setfocus); 36 | @@ -1735,6 +1736,14 @@ togglefloating(const Arg *arg) 37 | arrange(selmon); 38 | } 39 | 40 | +void 41 | +togglefullscreen(const Arg *arg) { 42 | + if (!selmon->sel) 43 | + return; 44 | + 45 | + setfullscreen(selmon->sel, !selmon->sel->isfullscreen); 46 | +} 47 | + 48 | void 49 | toggletag(const Arg *arg) 50 | { 51 | -- 52 | 2.45.2 53 | 54 | -------------------------------------------------------------------------------- /dwm/dwm-togglefullscreen-6.6.diff: -------------------------------------------------------------------------------- 1 | From ce4b924e27bbbe262d448d74f86de4cf421ab95e Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:50:34 +0200 4 | Subject: [PATCH] togglefullscreen patch 5 | 6 | Allows you to toggle fullscreen on and off using the same shortcut key. 7 | --- 8 | config.def.h | 1 + 9 | dwm.c | 9 +++++++++ 10 | 2 files changed, 10 insertions(+) 11 | 12 | diff --git a/config.def.h b/config.def.h 13 | index 9efa774..aa29b45 100644 14 | --- a/config.def.h 15 | +++ b/config.def.h 16 | @@ -79,6 +79,7 @@ static const Key keys[] = { 17 | { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, 18 | { MODKEY, XK_space, setlayout, {0} }, 19 | { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 20 | + { MODKEY, XK_y, togglefullscreen, {0} }, 21 | { MODKEY, XK_0, view, {.ui = ~0 } }, 22 | { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 23 | { MODKEY, XK_comma, focusmon, {.i = -1 } }, 24 | diff --git a/dwm.c b/dwm.c 25 | index 1443802..614bc92 100644 26 | --- a/dwm.c 27 | +++ b/dwm.c 28 | @@ -210,6 +210,7 @@ static void tagmon(const Arg *arg); 29 | static void tile(Monitor *m); 30 | static void togglebar(const Arg *arg); 31 | static void togglefloating(const Arg *arg); 32 | +static void togglefullscreen(const Arg *arg); 33 | static void toggletag(const Arg *arg); 34 | static void toggleview(const Arg *arg); 35 | static void unfocus(Client *c, int setfocus); 36 | @@ -1734,6 +1735,14 @@ togglefloating(const Arg *arg) 37 | arrange(selmon); 38 | } 39 | 40 | +void 41 | +togglefullscreen(const Arg *arg) { 42 | + if (!selmon->sel) 43 | + return; 44 | + 45 | + setfullscreen(selmon->sel, !selmon->sel->isfullscreen); 46 | +} 47 | + 48 | void 49 | toggletag(const Arg *arg) 50 | { 51 | -- 52 | 2.50.1 53 | 54 | -------------------------------------------------------------------------------- /dwm/dwm-banish-cursorwarp-6.4.diff: -------------------------------------------------------------------------------- 1 | From 2d9dd6a13f402f61e890cbbac4234f7c821bd1de Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 24 Jun 2024 09:59:29 +0200 4 | Subject: [PATCH 2/2] Adding cursorwarp patch on top of banish 5 | 6 | --- 7 | dwm.c | 20 ++++++++++++++++++++ 8 | 1 file changed, 20 insertions(+) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index bb7760b..1a8e311 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -238,6 +238,7 @@ static void updatetitle(Client *c); 15 | static void updatewindowtype(Client *c); 16 | static void updatewmhints(Client *c); 17 | static void view(const Arg *arg); 18 | +static void warp(Client *c); 19 | static Client *wintoclient(Window w); 20 | static Monitor *wintomon(Window w); 21 | static int xerror(Display *dpy, XErrorEvent *ee); 22 | @@ -867,6 +868,8 @@ focusmon(const Arg *arg) 23 | unfocus(selmon->sel, 0); 24 | selmon = m; 25 | focus(NULL); 26 | + if (m->sel) 27 | + warp(m->sel) 28 | } 29 | 30 | void 31 | @@ -892,6 +895,7 @@ focusstack(const Arg *arg) 32 | if (c) { 33 | focus(c); 34 | restack(selmon); 35 | + warp(c) 36 | } 37 | } 38 | 39 | @@ -1159,6 +1163,8 @@ manage(Window w, XWindowAttributes *wa) 40 | c->mon->sel = c; 41 | arrange(c->mon); 42 | XMapWindow(dpy, c->win); 43 | + if (c && c->mon == selmon && ISVISIBLE(c)) 44 | + warp(c); 45 | focus(NULL); 46 | } 47 | 48 | @@ -1919,6 +1925,8 @@ unmanage(Client *c, int destroyed) 49 | focus(NULL); 50 | updateclientlist(); 51 | arrange(m); 52 | + if (m->sel && m == selmon) 53 | + warp(m->sel); 54 | } 55 | 56 | void 57 | @@ -2182,6 +2190,18 @@ view(const Arg *arg) 58 | arrange(selmon); 59 | } 60 | 61 | +void 62 | +warp(Client *c) 63 | +{ 64 | + if (cursor_hidden) { 65 | + mouse_x = c->x + c->w/2; 66 | + mouse_y = c->y + c->h/2; 67 | + return; 68 | + } 69 | + 70 | + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); 71 | +} 72 | + 73 | Client * 74 | wintoclient(Window w) 75 | { 76 | -- 77 | 2.45.2 78 | 79 | -------------------------------------------------------------------------------- /dwm/dwm-banish-cursorwarp-6.5.diff: -------------------------------------------------------------------------------- 1 | From 3a3eb86264d4f6aef8f2c0942d8174bb509ec06f Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 23:06:53 +0200 4 | Subject: [PATCH 2/2] Adding cursorwarp patch on top of banish 5 | 6 | --- 7 | dwm.c | 20 ++++++++++++++++++++ 8 | 1 file changed, 20 insertions(+) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index 0b554f9..9ed5e03 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -237,6 +237,7 @@ static void updatetitle(Client *c); 15 | static void updatewindowtype(Client *c); 16 | static void updatewmhints(Client *c); 17 | static void view(const Arg *arg); 18 | +static void warp(Client *c); 19 | static Client *wintoclient(Window w); 20 | static Monitor *wintomon(Window w); 21 | static int xerror(Display *dpy, XErrorEvent *ee); 22 | @@ -866,6 +867,8 @@ focusmon(const Arg *arg) 23 | unfocus(selmon->sel, 0); 24 | selmon = m; 25 | focus(NULL); 26 | + if (m->sel) 27 | + warp(m->sel) 28 | } 29 | 30 | void 31 | @@ -891,6 +894,7 @@ focusstack(const Arg *arg) 32 | if (c) { 33 | focus(c); 34 | restack(selmon); 35 | + warp(c) 36 | } 37 | } 38 | 39 | @@ -1168,6 +1172,8 @@ manage(Window w, XWindowAttributes *wa) 40 | c->mon->sel = c; 41 | arrange(c->mon); 42 | XMapWindow(dpy, c->win); 43 | + if (c && c->mon == selmon && ISVISIBLE(c)) 44 | + warp(c); 45 | focus(NULL); 46 | } 47 | 48 | @@ -1937,6 +1943,8 @@ unmanage(Client *c, int destroyed) 49 | focus(NULL); 50 | updateclientlist(); 51 | arrange(m); 52 | + if (m->sel && m == selmon) 53 | + warp(m->sel); 54 | } 55 | 56 | void 57 | @@ -2200,6 +2208,18 @@ view(const Arg *arg) 58 | arrange(selmon); 59 | } 60 | 61 | +void 62 | +warp(Client *c) 63 | +{ 64 | + if (cursor_hidden) { 65 | + mouse_x = c->x + c->w/2; 66 | + mouse_y = c->y + c->h/2; 67 | + return; 68 | + } 69 | + 70 | + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); 71 | +} 72 | + 73 | Client * 74 | wintoclient(Window w) 75 | { 76 | -- 77 | 2.45.2 78 | 79 | -------------------------------------------------------------------------------- /dwm/dwm-banish-cursorwarp-6.6.diff: -------------------------------------------------------------------------------- 1 | From a8237d70f7beb937f0dc457544dd084e20c53056 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 23:06:53 +0200 4 | Subject: [PATCH 2/2] Adding cursorwarp patch on top of banish 5 | 6 | --- 7 | dwm.c | 20 ++++++++++++++++++++ 8 | 1 file changed, 20 insertions(+) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index 7fcab53..c094164 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -236,6 +236,7 @@ static void updatetitle(Client *c); 15 | static void updatewindowtype(Client *c); 16 | static void updatewmhints(Client *c); 17 | static void view(const Arg *arg); 18 | +static void warp(Client *c); 19 | static Client *wintoclient(Window w); 20 | static Monitor *wintomon(Window w); 21 | static int xerror(Display *dpy, XErrorEvent *ee); 22 | @@ -865,6 +866,8 @@ focusmon(const Arg *arg) 23 | unfocus(selmon->sel, 0); 24 | selmon = m; 25 | focus(NULL); 26 | + if (m->sel) 27 | + warp(m->sel) 28 | } 29 | 30 | void 31 | @@ -890,6 +893,7 @@ focusstack(const Arg *arg) 32 | if (c) { 33 | focus(c); 34 | restack(selmon); 35 | + warp(c) 36 | } 37 | } 38 | 39 | @@ -1167,6 +1171,8 @@ manage(Window w, XWindowAttributes *wa) 40 | c->mon->sel = c; 41 | arrange(c->mon); 42 | XMapWindow(dpy, c->win); 43 | + if (c && c->mon == selmon && ISVISIBLE(c)) 44 | + warp(c); 45 | focus(NULL); 46 | } 47 | 48 | @@ -1936,6 +1942,8 @@ unmanage(Client *c, int destroyed) 49 | focus(NULL); 50 | updateclientlist(); 51 | arrange(m); 52 | + if (m->sel && m == selmon) 53 | + warp(m->sel); 54 | } 55 | 56 | void 57 | @@ -2199,6 +2207,18 @@ view(const Arg *arg) 58 | arrange(selmon); 59 | } 60 | 61 | +void 62 | +warp(Client *c) 63 | +{ 64 | + if (cursor_hidden) { 65 | + mouse_x = c->x + c->w/2; 66 | + mouse_y = c->y + c->h/2; 67 | + return; 68 | + } 69 | + 70 | + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); 71 | +} 72 | + 73 | Client * 74 | wintoclient(Window w) 75 | { 76 | -- 77 | 2.50.1 78 | 79 | -------------------------------------------------------------------------------- /dwm/dwm-tagicons-selected-6.5.diff: -------------------------------------------------------------------------------- 1 | From 391a2500cb508bf64e7259c8f274ef7a3faa95df Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 23:39:08 +0200 4 | Subject: [PATCH 2/2] tagicons with separate icon for selected tags 5 | 6 | --- 7 | config.def.h | 5 +++-- 8 | dwm.c | 5 ++++- 9 | 2 files changed, 7 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/config.def.h b/config.def.h 12 | index 7953203..c8a8681 100644 13 | --- a/config.def.h 14 | +++ b/config.def.h 15 | @@ -21,9 +21,10 @@ static const char *colors[][3] = { 16 | /* tagging: refer to https://github.com/bakkeby/patches/wiki/tagicons */ 17 | static const char *tags[NUMTAGS] = { NULL }; /* left for compatibility reasons, i.e. code that checks LENGTH(tags) */ 18 | static char *tagicons[][NUMTAGS] = { 19 | - [IconsDefault] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }, 20 | + [IconsDefault] = { "○" }, 21 | [IconsVacant] = { NULL }, 22 | - [IconsOccupied] = { NULL }, 23 | + [IconsOccupied] = { "☉" }, 24 | + [IconsSelected] = { "◉" }, 25 | }; 26 | 27 | static const Rule rules[] = { 28 | diff --git a/dwm.c b/dwm.c 29 | index bb48a4e..bc51463 100644 30 | --- a/dwm.c 31 | +++ b/dwm.c 32 | @@ -71,6 +71,7 @@ enum { 33 | IconsDefault, 34 | IconsVacant, 35 | IconsOccupied, 36 | + IconsSelected, 37 | IconsLast 38 | }; /* icon sets */ 39 | 40 | @@ -1743,7 +1744,9 @@ tagicon(Monitor *m, int tag) 41 | char *icon; 42 | for (c = m->clients; c && (!(c->tags & 1 << tag)); c = c->next); 43 | // for (c = m->clients; c && (!(c->tags & 1 << tag) || HIDDEN(c)); c = c->next); // awesomebar / wintitleactions compatibility 44 | - if (c && tagicons[IconsOccupied][0] != NULL) 45 | + if (m->tagset[m->seltags] & 1 << tag && tagicons[IconsSelected][0] != NULL) 46 | + icon = geticon(m, tag, IconsSelected); 47 | + else if (c && tagicons[IconsOccupied][0] != NULL) 48 | icon = geticon(m, tag, IconsOccupied); 49 | else { 50 | icon = geticon(m, tag, m->iconset); 51 | -- 52 | 2.45.2 53 | 54 | -------------------------------------------------------------------------------- /dwm/dwm-tagicons-selected-6.6.diff: -------------------------------------------------------------------------------- 1 | From 6280e45d23157fbb5f3e5fb1dec194697f397bb8 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 23:39:08 +0200 4 | Subject: [PATCH 2/2] tagicons with separate icon for selected tags 5 | 6 | --- 7 | config.def.h | 5 +++-- 8 | dwm.c | 5 ++++- 9 | 2 files changed, 7 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/config.def.h b/config.def.h 12 | index 7953203..c8a8681 100644 13 | --- a/config.def.h 14 | +++ b/config.def.h 15 | @@ -21,9 +21,10 @@ static const char *colors[][3] = { 16 | /* tagging: refer to https://github.com/bakkeby/patches/wiki/tagicons */ 17 | static const char *tags[NUMTAGS] = { NULL }; /* left for compatibility reasons, i.e. code that checks LENGTH(tags) */ 18 | static char *tagicons[][NUMTAGS] = { 19 | - [IconsDefault] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }, 20 | + [IconsDefault] = { "○" }, 21 | [IconsVacant] = { NULL }, 22 | - [IconsOccupied] = { NULL }, 23 | + [IconsOccupied] = { "☉" }, 24 | + [IconsSelected] = { "◉" }, 25 | }; 26 | 27 | static const Rule rules[] = { 28 | diff --git a/dwm.c b/dwm.c 29 | index d785daf..e7ebd14 100644 30 | --- a/dwm.c 31 | +++ b/dwm.c 32 | @@ -70,6 +70,7 @@ enum { 33 | IconsDefault, 34 | IconsVacant, 35 | IconsOccupied, 36 | + IconsSelected, 37 | IconsLast 38 | }; /* icon sets */ 39 | 40 | @@ -1742,7 +1743,9 @@ tagicon(Monitor *m, int tag) 41 | char *icon; 42 | for (c = m->clients; c && (!(c->tags & 1 << tag)); c = c->next); 43 | // for (c = m->clients; c && (!(c->tags & 1 << tag) || HIDDEN(c)); c = c->next); // awesomebar / wintitleactions compatibility 44 | - if (c && tagicons[IconsOccupied][0] != NULL) 45 | + if (m->tagset[m->seltags] & 1 << tag && tagicons[IconsSelected][0] != NULL) 46 | + icon = geticon(m, tag, IconsSelected); 47 | + else if (c && tagicons[IconsOccupied][0] != NULL) 48 | icon = geticon(m, tag, IconsOccupied); 49 | else { 50 | icon = geticon(m, tag, m->iconset); 51 | -- 52 | 2.50.1 53 | 54 | -------------------------------------------------------------------------------- /dwm/dwm-no_border_for_unselected_clients-6.3.diff: -------------------------------------------------------------------------------- 1 | From cb5a8471e37fd4637976cb059343705a43293e59 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:42:12 +0200 4 | Subject: [PATCH] Adding no border for unselected clients patch 5 | 6 | --- 7 | dwm.c | 18 ++++++++++++++++-- 8 | 1 file changed, 16 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index a96f33c..1450e65 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -806,6 +806,8 @@ focus(Client *c) 15 | XDeleteProperty(dpy, root, netatom[NetActiveWindow]); 16 | } 17 | selmon->sel = c; 18 | + if (selmon->sel) 19 | + resizeclient(c, c->x, c->y, c->w, c->h); 20 | drawbars(); 21 | } 22 | 23 | @@ -1285,7 +1287,13 @@ resizeclient(Client *c, int x, int y, int w, int h) 24 | c->oldy = c->y; c->y = wc.y = y; 25 | c->oldw = c->w; c->w = wc.width = w; 26 | c->oldh = c->h; c->h = wc.height = h; 27 | - wc.border_width = c->bw; 28 | + if (c == selmon->sel) 29 | + wc.border_width = c->bw; 30 | + else { 31 | + wc.border_width = 0; 32 | + wc.x += c->bw; 33 | + wc.y += c->bw; 34 | + } 35 | XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); 36 | configure(c); 37 | XSync(dpy, False); 38 | @@ -1621,7 +1629,10 @@ showhide(Client *c) 39 | return; 40 | if (ISVISIBLE(c)) { 41 | /* show clients top down */ 42 | - XMoveWindow(dpy, c->win, c->x, c->y); 43 | + if (selmon->sel == c) 44 | + XMoveWindow(dpy, c->win, c->x, c->y); 45 | + else 46 | + XMoveWindow(dpy, c->win, c->x + borderpx, c->y + borderpx); 47 | if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen) 48 | resize(c, c->x, c->y, c->w, c->h, 0); 49 | showhide(c->snext); 50 | @@ -1763,6 +1774,9 @@ unfocus(Client *c, int setfocus) 51 | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); 52 | XDeleteProperty(dpy, root, netatom[NetActiveWindow]); 53 | } 54 | + if (c == selmon->sel) 55 | + selmon->sel = NULL; 56 | + resizeclient(c, c->x, c->y, c->w, c->h); 57 | } 58 | 59 | void 60 | -- 61 | 2.45.2 62 | 63 | -------------------------------------------------------------------------------- /dwm/dwm-no_border_for_unselected_clients-6.5.diff: -------------------------------------------------------------------------------- 1 | From 611b9a9ef57795bd7481b118975044d98adf3130 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:42:02 +0200 4 | Subject: [PATCH] Adding no border for unselected clients patch 5 | 6 | --- 7 | dwm.c | 18 ++++++++++++++++-- 8 | 1 file changed, 16 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index f1d86b2..2d1eafe 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -808,6 +808,8 @@ focus(Client *c) 15 | XDeleteProperty(dpy, root, netatom[NetActiveWindow]); 16 | } 17 | selmon->sel = c; 18 | + if (selmon->sel) 19 | + resizeclient(c, c->x, c->y, c->w, c->h); 20 | drawbars(); 21 | } 22 | 23 | @@ -1291,7 +1293,13 @@ resizeclient(Client *c, int x, int y, int w, int h) 24 | c->oldy = c->y; c->y = wc.y = y; 25 | c->oldw = c->w; c->w = wc.width = w; 26 | c->oldh = c->h; c->h = wc.height = h; 27 | - wc.border_width = c->bw; 28 | + if (c == selmon->sel) 29 | + wc.border_width = c->bw; 30 | + else { 31 | + wc.border_width = 0; 32 | + wc.x += c->bw; 33 | + wc.y += c->bw; 34 | + } 35 | XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); 36 | configure(c); 37 | XSync(dpy, False); 38 | @@ -1633,7 +1641,10 @@ showhide(Client *c) 39 | return; 40 | if (ISVISIBLE(c)) { 41 | /* show clients top down */ 42 | - XMoveWindow(dpy, c->win, c->x, c->y); 43 | + if (selmon->sel == c) 44 | + XMoveWindow(dpy, c->win, c->x, c->y); 45 | + else 46 | + XMoveWindow(dpy, c->win, c->x + borderpx, c->y + borderpx); 47 | if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen) 48 | resize(c, c->x, c->y, c->w, c->h, 0); 49 | showhide(c->snext); 50 | @@ -1773,6 +1784,9 @@ unfocus(Client *c, int setfocus) 51 | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); 52 | XDeleteProperty(dpy, root, netatom[NetActiveWindow]); 53 | } 54 | + if (c == selmon->sel) 55 | + selmon->sel = NULL; 56 | + resizeclient(c, c->x, c->y, c->w, c->h); 57 | } 58 | 59 | void 60 | -- 61 | 2.45.2 62 | 63 | -------------------------------------------------------------------------------- /dwm/dwm-no_border_for_unselected_clients-6.6.diff: -------------------------------------------------------------------------------- 1 | From bd7d22b247c5b4f4a60c6459c0334a216b1019f0 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:42:02 +0200 4 | Subject: [PATCH] Adding no border for unselected clients patch 5 | 6 | --- 7 | dwm.c | 18 ++++++++++++++++-- 8 | 1 file changed, 16 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index 1443802..e90fd23 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -807,6 +807,8 @@ focus(Client *c) 15 | XDeleteProperty(dpy, root, netatom[NetActiveWindow]); 16 | } 17 | selmon->sel = c; 18 | + if (selmon->sel) 19 | + resizeclient(c, c->x, c->y, c->w, c->h); 20 | drawbars(); 21 | } 22 | 23 | @@ -1290,7 +1292,13 @@ resizeclient(Client *c, int x, int y, int w, int h) 24 | c->oldy = c->y; c->y = wc.y = y; 25 | c->oldw = c->w; c->w = wc.width = w; 26 | c->oldh = c->h; c->h = wc.height = h; 27 | - wc.border_width = c->bw; 28 | + if (c == selmon->sel) 29 | + wc.border_width = c->bw; 30 | + else { 31 | + wc.border_width = 0; 32 | + wc.x += c->bw; 33 | + wc.y += c->bw; 34 | + } 35 | XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); 36 | configure(c); 37 | XSync(dpy, False); 38 | @@ -1632,7 +1640,10 @@ showhide(Client *c) 39 | return; 40 | if (ISVISIBLE(c)) { 41 | /* show clients top down */ 42 | - XMoveWindow(dpy, c->win, c->x, c->y); 43 | + if (selmon->sel == c) 44 | + XMoveWindow(dpy, c->win, c->x, c->y); 45 | + else 46 | + XMoveWindow(dpy, c->win, c->x + borderpx, c->y + borderpx); 47 | if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen) 48 | resize(c, c->x, c->y, c->w, c->h, 0); 49 | showhide(c->snext); 50 | @@ -1772,6 +1783,9 @@ unfocus(Client *c, int setfocus) 51 | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); 52 | XDeleteProperty(dpy, root, netatom[NetActiveWindow]); 53 | } 54 | + if (c == selmon->sel) 55 | + selmon->sel = NULL; 56 | + resizeclient(c, c->x, c->y, c->w, c->h); 57 | } 58 | 59 | void 60 | -- 61 | 2.50.1 62 | 63 | -------------------------------------------------------------------------------- /dwm/dwm-no-border-for-unselected-clients-20200922-61bb8b2.diff: -------------------------------------------------------------------------------- 1 | From c9065974a21579061b699e6eedc44239289b58de Mon Sep 17 00:00:00 2001 2 | From: bakkeby 3 | Date: Tue, 22 Sep 2020 15:07:01 +0200 4 | Subject: [PATCH] dwm_no_border_for_unselected_clients 5 | 6 | --- 7 | dwm.c | 18 ++++++++++++++++-- 8 | 1 file changed, 16 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index 664c527..1c6ddfc 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -803,6 +803,8 @@ focus(Client *c) 15 | XDeleteProperty(dpy, root, netatom[NetActiveWindow]); 16 | } 17 | selmon->sel = c; 18 | + if (selmon->sel) 19 | + resizeclient(c, c->x, c->y, c->w, c->h); 20 | drawbars(); 21 | } 22 | 23 | @@ -1282,7 +1284,13 @@ resizeclient(Client *c, int x, int y, int w, int h) 24 | c->oldy = c->y; c->y = wc.y = y; 25 | c->oldw = c->w; c->w = wc.width = w; 26 | c->oldh = c->h; c->h = wc.height = h; 27 | - wc.border_width = c->bw; 28 | + if (c == selmon->sel) 29 | + wc.border_width = c->bw; 30 | + else { 31 | + wc.border_width = 0; 32 | + wc.x += c->bw; 33 | + wc.y += c->bw; 34 | + } 35 | XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); 36 | configure(c); 37 | XSync(dpy, False); 38 | @@ -1618,7 +1626,10 @@ showhide(Client *c) 39 | return; 40 | if (ISVISIBLE(c)) { 41 | /* show clients top down */ 42 | - XMoveWindow(dpy, c->win, c->x, c->y); 43 | + if (selmon->sel == c) 44 | + XMoveWindow(dpy, c->win, c->x, c->y); 45 | + else 46 | + XMoveWindow(dpy, c->win, c->x + borderpx, c->y + borderpx); 47 | if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen) 48 | resize(c, c->x, c->y, c->w, c->h, 0); 49 | showhide(c->snext); 50 | @@ -1760,6 +1771,9 @@ unfocus(Client *c, int setfocus) 51 | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); 52 | XDeleteProperty(dpy, root, netatom[NetActiveWindow]); 53 | } 54 | + if (c == selmon->sel) 55 | + selmon->sel = NULL; 56 | + resizeclient(c, c->x, c->y, c->w, c->h); 57 | } 58 | 59 | void 60 | -- 61 | 2.32.0 62 | 63 | -------------------------------------------------------------------------------- /dwm/dwm-focusonnetactive-6.2.diff: -------------------------------------------------------------------------------- 1 | From 91faf0948d920f7a843ddaed2fcf6f08669666d9 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:10:46 +0200 4 | Subject: [PATCH] Activate a window in response to _NET_ACTIVE_WINDOW 5 | 6 | By default, dwm response to client requests to _NET_ACTIVE_WINDOW client 7 | messages by setting the urgency bit on the named window. 8 | 9 | This patch activates the window instead. 10 | 11 | Both behaviours are legitimate according to 12 | https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html#idm140200472702304 13 | 14 | One should decide which of these one should perform based on the message 15 | senders' untestable claims that it represents the end-user. Setting the 16 | urgency bit is the conservative decision. This patch implements the more 17 | trusting alternative. 18 | 19 | It also allows dwm to work with `wmctrl -a` and other external window 20 | management utilities 21 | 22 | Refer to: 23 | https://dwm.suckless.org/patches/focusonnetactive/ 24 | --- 25 | dwm.c | 12 ++++++++++-- 26 | 1 file changed, 10 insertions(+), 2 deletions(-) 27 | 28 | diff --git a/dwm.c b/dwm.c 29 | index 4465af1..4ca8891 100644 30 | --- a/dwm.c 31 | +++ b/dwm.c 32 | @@ -514,6 +514,7 @@ clientmessage(XEvent *e) 33 | { 34 | XClientMessageEvent *cme = &e->xclient; 35 | Client *c = wintoclient(cme->window); 36 | + unsigned int i; 37 | 38 | if (!c) 39 | return; 40 | @@ -523,8 +524,15 @@ clientmessage(XEvent *e) 41 | setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ 42 | || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen))); 43 | } else if (cme->message_type == netatom[NetActiveWindow]) { 44 | - if (c != selmon->sel && !c->isurgent) 45 | - seturgent(c, 1); 46 | + for (i = 0; i < LENGTH(tags) && !((1 << i) & c->tags); i++); 47 | + if (i < LENGTH(tags)) { 48 | + const Arg a = {.ui = 1 << i}; 49 | + unfocus(selmon->sel, 0); 50 | + selmon = c->mon; 51 | + view(&a); 52 | + focus(c); 53 | + restack(selmon); 54 | + } 55 | } 56 | } 57 | 58 | -- 59 | 2.45.2 60 | 61 | -------------------------------------------------------------------------------- /dwm/dwm-focusonnetactive-6.3.diff: -------------------------------------------------------------------------------- 1 | From aaca322b309768a81188b7063a22b4731402902c Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:12:17 +0200 4 | Subject: [PATCH] Activate a window in response to _NET_ACTIVE_WINDOW 5 | 6 | By default, dwm response to client requests to _NET_ACTIVE_WINDOW client 7 | messages by setting the urgency bit on the named window. 8 | 9 | This patch activates the window instead. 10 | 11 | Both behaviours are legitimate according to 12 | https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html#idm140200472702304 13 | 14 | One should decide which of these one should perform based on the message 15 | senders' untestable claims that it represents the end-user. Setting the 16 | urgency bit is the conservative decision. This patch implements the more 17 | trusting alternative. 18 | 19 | It also allows dwm to work with `wmctrl -a` and other external window 20 | management utilities 21 | 22 | Refer to: 23 | https://dwm.suckless.org/patches/focusonnetactive/ 24 | --- 25 | dwm.c | 12 ++++++++++-- 26 | 1 file changed, 10 insertions(+), 2 deletions(-) 27 | 28 | diff --git a/dwm.c b/dwm.c 29 | index a96f33c..44d55b1 100644 30 | --- a/dwm.c 31 | +++ b/dwm.c 32 | @@ -515,6 +515,7 @@ clientmessage(XEvent *e) 33 | { 34 | XClientMessageEvent *cme = &e->xclient; 35 | Client *c = wintoclient(cme->window); 36 | + unsigned int i; 37 | 38 | if (!c) 39 | return; 40 | @@ -524,8 +525,15 @@ clientmessage(XEvent *e) 41 | setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ 42 | || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen))); 43 | } else if (cme->message_type == netatom[NetActiveWindow]) { 44 | - if (c != selmon->sel && !c->isurgent) 45 | - seturgent(c, 1); 46 | + for (i = 0; i < LENGTH(tags) && !((1 << i) & c->tags); i++); 47 | + if (i < LENGTH(tags)) { 48 | + const Arg a = {.ui = 1 << i}; 49 | + unfocus(selmon->sel, 0); 50 | + selmon = c->mon; 51 | + view(&a); 52 | + focus(c); 53 | + restack(selmon); 54 | + } 55 | } 56 | } 57 | 58 | -- 59 | 2.45.2 60 | 61 | -------------------------------------------------------------------------------- /dwm/dwm-tagicons-selected-6.2.diff: -------------------------------------------------------------------------------- 1 | From 72e8a4eb0b0cbe2fc5aa5bf809ae407d17f1a640 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:55:32 +0200 4 | Subject: [PATCH 2/2] tagicons with separate icon for selected tags 5 | 6 | Example patch ref. 7 | https://www.reddit.com/r/suckless/comments/ln0t41/use_icon_instead_of_rectangle_as/ 8 | --- 9 | config.def.h | 5 +++-- 10 | dwm.c | 5 ++++- 11 | 2 files changed, 7 insertions(+), 3 deletions(-) 12 | 13 | diff --git a/config.def.h b/config.def.h 14 | index d82e4df..7607155 100644 15 | --- a/config.def.h 16 | +++ b/config.def.h 17 | @@ -21,9 +21,10 @@ static const char *colors[][3] = { 18 | /* tagging: refer to https://github.com/bakkeby/patches/wiki/tagicons */ 19 | static const char *tags[NUMTAGS] = { NULL }; /* left for compatibility reasons, i.e. code that checks LENGTH(tags) */ 20 | static char *tagicons[][NUMTAGS] = { 21 | - [IconsDefault] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }, 22 | + [IconsDefault] = { "○" }, 23 | [IconsVacant] = { NULL }, 24 | - [IconsOccupied] = { NULL }, 25 | + [IconsOccupied] = { "☉" }, 26 | + [IconsSelected] = { "◉" }, 27 | }; 28 | 29 | static const Rule rules[] = { 30 | diff --git a/dwm.c b/dwm.c 31 | index 614a9ef..b28febd 100644 32 | --- a/dwm.c 33 | +++ b/dwm.c 34 | @@ -71,6 +71,7 @@ enum { 35 | IconsDefault, 36 | IconsVacant, 37 | IconsOccupied, 38 | + IconsSelected, 39 | IconsLast 40 | }; /* icon sets */ 41 | 42 | @@ -1729,7 +1730,9 @@ tagicon(Monitor *m, int tag) 43 | char *icon; 44 | for (c = m->clients; c && (!(c->tags & 1 << tag)); c = c->next); 45 | // for (c = m->clients; c && (!(c->tags & 1 << tag) || HIDDEN(c)); c = c->next); // awesomebar / wintitleactions compatibility 46 | - if (c && tagicons[IconsOccupied][0] != NULL) 47 | + if (m->tagset[m->seltags] & 1 << tag && tagicons[IconsSelected][0] != NULL) 48 | + icon = geticon(m, tag, IconsSelected); 49 | + else if (c && tagicons[IconsOccupied][0] != NULL) 50 | icon = geticon(m, tag, IconsOccupied); 51 | else { 52 | icon = geticon(m, tag, m->iconset); 53 | -- 54 | 2.45.2 55 | 56 | -------------------------------------------------------------------------------- /dwm/dwm-tagicons-selected-6.3.diff: -------------------------------------------------------------------------------- 1 | From 6a4b2e73b39a57b0d7f042b9740263ec44f8db56 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:54:39 +0200 4 | Subject: [PATCH 2/2] tagicons with separate icon for selected tags 5 | 6 | Example patch ref. 7 | https://www.reddit.com/r/suckless/comments/ln0t41/use_icon_instead_of_rectangle_as/ 8 | --- 9 | config.def.h | 5 +++-- 10 | dwm.c | 5 ++++- 11 | 2 files changed, 7 insertions(+), 3 deletions(-) 12 | 13 | diff --git a/config.def.h b/config.def.h 14 | index 7e63669..84d80c4 100644 15 | --- a/config.def.h 16 | +++ b/config.def.h 17 | @@ -21,9 +21,10 @@ static const char *colors[][3] = { 18 | /* tagging: refer to https://github.com/bakkeby/patches/wiki/tagicons */ 19 | static const char *tags[NUMTAGS] = { NULL }; /* left for compatibility reasons, i.e. code that checks LENGTH(tags) */ 20 | static char *tagicons[][NUMTAGS] = { 21 | - [IconsDefault] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }, 22 | + [IconsDefault] = { "○" }, 23 | [IconsVacant] = { NULL }, 24 | - [IconsOccupied] = { NULL }, 25 | + [IconsOccupied] = { "☉" }, 26 | + [IconsSelected] = { "◉" }, 27 | }; 28 | 29 | static const Rule rules[] = { 30 | diff --git a/dwm.c b/dwm.c 31 | index 63b800f..f6fb72a 100644 32 | --- a/dwm.c 33 | +++ b/dwm.c 34 | @@ -71,6 +71,7 @@ enum { 35 | IconsDefault, 36 | IconsVacant, 37 | IconsOccupied, 38 | + IconsSelected, 39 | IconsLast 40 | }; /* icon sets */ 41 | 42 | @@ -1733,7 +1734,9 @@ tagicon(Monitor *m, int tag) 43 | char *icon; 44 | for (c = m->clients; c && (!(c->tags & 1 << tag)); c = c->next); 45 | // for (c = m->clients; c && (!(c->tags & 1 << tag) || HIDDEN(c)); c = c->next); // awesomebar / wintitleactions compatibility 46 | - if (c && tagicons[IconsOccupied][0] != NULL) 47 | + if (m->tagset[m->seltags] & 1 << tag && tagicons[IconsSelected][0] != NULL) 48 | + icon = geticon(m, tag, IconsSelected); 49 | + else if (c && tagicons[IconsOccupied][0] != NULL) 50 | icon = geticon(m, tag, IconsOccupied); 51 | else { 52 | icon = geticon(m, tag, m->iconset); 53 | -- 54 | 2.45.2 55 | 56 | -------------------------------------------------------------------------------- /dwm/dwm-attachbottom-6.5.diff: -------------------------------------------------------------------------------- 1 | From c9ccb7661ee3b6fd9fca170a57b53d9e842c74e8 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 24 Jun 2024 09:53:55 +0200 4 | Subject: [PATCH] attachbottom patch 5 | 6 | New clients attach at the bottom of the stack instead of the top. 7 | --- 8 | dwm.c | 19 ++++++++++++++++--- 9 | 1 file changed, 16 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index f1d86b2..f2edb49 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -147,6 +147,7 @@ static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interac 16 | static void arrange(Monitor *m); 17 | static void arrangemon(Monitor *m); 18 | static void attach(Client *c); 19 | +static void attachbottom(Client *c); 20 | static void attachstack(Client *c); 21 | static void buttonpress(XEvent *e); 22 | static void checkotherwm(void); 23 | @@ -408,6 +409,18 @@ attach(Client *c) 24 | c->mon->clients = c; 25 | } 26 | 27 | +void 28 | +attachbottom(Client *c) 29 | +{ 30 | + Client *below = c->mon->clients; 31 | + for (; below && below->next; below = below->next); 32 | + c->next = NULL; 33 | + if (below) 34 | + below->next = c; 35 | + else 36 | + c->mon->clients = c; 37 | +} 38 | + 39 | void 40 | attachstack(Client *c) 41 | { 42 | @@ -1074,7 +1087,7 @@ manage(Window w, XWindowAttributes *wa) 43 | c->isfloating = c->oldstate = trans != None || c->isfixed; 44 | if (c->isfloating) 45 | XRaiseWindow(dpy, c->win); 46 | - attach(c); 47 | + attachbottom(c); 48 | attachstack(c); 49 | XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, 50 | (unsigned char *) &(c->win), 1); 51 | @@ -1427,7 +1440,7 @@ sendmon(Client *c, Monitor *m) 52 | detachstack(c); 53 | c->mon = m; 54 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 55 | - attach(c); 56 | + attachbottom(c); 57 | attachstack(c); 58 | focus(NULL); 59 | arrange(NULL); 60 | @@ -1915,7 +1928,7 @@ updategeom(void) 61 | m->clients = c->next; 62 | detachstack(c); 63 | c->mon = mons; 64 | - attach(c); 65 | + attachbottom(c); 66 | attachstack(c); 67 | } 68 | if (m == selmon) 69 | -- 70 | 2.45.2 71 | 72 | -------------------------------------------------------------------------------- /dwm/dwm-attachbottom-6.6.diff: -------------------------------------------------------------------------------- 1 | From cde46a264c646ce44e0d5d56fe6adfcf95998ce1 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 24 Jun 2024 09:53:55 +0200 4 | Subject: [PATCH] attachbottom patch 5 | 6 | New clients attach at the bottom of the stack instead of the top. 7 | --- 8 | dwm.c | 19 ++++++++++++++++--- 9 | 1 file changed, 16 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index 1443802..7b50d54 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -146,6 +146,7 @@ static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interac 16 | static void arrange(Monitor *m); 17 | static void arrangemon(Monitor *m); 18 | static void attach(Client *c); 19 | +static void attachbottom(Client *c); 20 | static void attachstack(Client *c); 21 | static void buttonpress(XEvent *e); 22 | static void checkotherwm(void); 23 | @@ -407,6 +408,18 @@ attach(Client *c) 24 | c->mon->clients = c; 25 | } 26 | 27 | +void 28 | +attachbottom(Client *c) 29 | +{ 30 | + Client *below = c->mon->clients; 31 | + for (; below && below->next; below = below->next); 32 | + c->next = NULL; 33 | + if (below) 34 | + below->next = c; 35 | + else 36 | + c->mon->clients = c; 37 | +} 38 | + 39 | void 40 | attachstack(Client *c) 41 | { 42 | @@ -1073,7 +1086,7 @@ manage(Window w, XWindowAttributes *wa) 43 | c->isfloating = c->oldstate = trans != None || c->isfixed; 44 | if (c->isfloating) 45 | XRaiseWindow(dpy, c->win); 46 | - attach(c); 47 | + attachbottom(c); 48 | attachstack(c); 49 | XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, 50 | (unsigned char *) &(c->win), 1); 51 | @@ -1426,7 +1439,7 @@ sendmon(Client *c, Monitor *m) 52 | detachstack(c); 53 | c->mon = m; 54 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 55 | - attach(c); 56 | + attachbottom(c); 57 | attachstack(c); 58 | focus(NULL); 59 | arrange(NULL); 60 | @@ -1914,7 +1927,7 @@ updategeom(void) 61 | m->clients = c->next; 62 | detachstack(c); 63 | c->mon = mons; 64 | - attach(c); 65 | + attachbottom(c); 66 | attachstack(c); 67 | } 68 | if (m == selmon) 69 | -- 70 | 2.50.1 71 | 72 | -------------------------------------------------------------------------------- /dwm/dwm-attachbottom-6.2.diff: -------------------------------------------------------------------------------- 1 | From 30fd6fb42eb1c9904c7f040c34a0f26588383a4d Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 24 Jun 2024 09:53:10 +0200 4 | Subject: [PATCH] attachbottom patch 5 | 6 | New clients attach at the bottom of the stack instead of the top. 7 | --- 8 | dwm.c | 19 ++++++++++++++++--- 9 | 1 file changed, 16 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index 4465af1..bf13d15 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -147,6 +147,7 @@ static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interac 16 | static void arrange(Monitor *m); 17 | static void arrangemon(Monitor *m); 18 | static void attach(Client *c); 19 | +static void attachbottom(Client *c); 20 | static void attachstack(Client *c); 21 | static void buttonpress(XEvent *e); 22 | static void checkotherwm(void); 23 | @@ -406,6 +407,18 @@ attach(Client *c) 24 | c->mon->clients = c; 25 | } 26 | 27 | +void 28 | +attachbottom(Client *c) 29 | +{ 30 | + Client *below = c->mon->clients; 31 | + for (; below && below->next; below = below->next); 32 | + c->next = NULL; 33 | + if (below) 34 | + below->next = c; 35 | + else 36 | + c->mon->clients = c; 37 | +} 38 | + 39 | void 40 | attachstack(Client *c) 41 | { 42 | @@ -1062,7 +1075,7 @@ manage(Window w, XWindowAttributes *wa) 43 | c->isfloating = c->oldstate = trans != None || c->isfixed; 44 | if (c->isfloating) 45 | XRaiseWindow(dpy, c->win); 46 | - attach(c); 47 | + attachbottom(c); 48 | attachstack(c); 49 | XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, 50 | (unsigned char *) &(c->win), 1); 51 | @@ -1417,7 +1430,7 @@ sendmon(Client *c, Monitor *m) 52 | detachstack(c); 53 | c->mon = m; 54 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 55 | - attach(c); 56 | + attachbottom(c); 57 | attachstack(c); 58 | focus(NULL); 59 | arrange(NULL); 60 | @@ -1897,7 +1910,7 @@ updategeom(void) 61 | m->clients = c->next; 62 | detachstack(c); 63 | c->mon = mons; 64 | - attach(c); 65 | + attachbottom(c); 66 | attachstack(c); 67 | } 68 | if (m == selmon) 69 | -- 70 | 2.45.2 71 | 72 | -------------------------------------------------------------------------------- /dwm/dwm-attachbottom-6.3.diff: -------------------------------------------------------------------------------- 1 | From 72d57efb6520e3a14a09bec7fb9afa11f6c6a53e Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 24 Jun 2024 09:53:55 +0200 4 | Subject: [PATCH] attachbottom patch 5 | 6 | New clients attach at the bottom of the stack instead of the top. 7 | --- 8 | dwm.c | 19 ++++++++++++++++--- 9 | 1 file changed, 16 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index a96f33c..15b0138 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -147,6 +147,7 @@ static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interac 16 | static void arrange(Monitor *m); 17 | static void arrangemon(Monitor *m); 18 | static void attach(Client *c); 19 | +static void attachbottom(Client *c); 20 | static void attachstack(Client *c); 21 | static void buttonpress(XEvent *e); 22 | static void checkotherwm(void); 23 | @@ -407,6 +408,18 @@ attach(Client *c) 24 | c->mon->clients = c; 25 | } 26 | 27 | +void 28 | +attachbottom(Client *c) 29 | +{ 30 | + Client *below = c->mon->clients; 31 | + for (; below && below->next; below = below->next); 32 | + c->next = NULL; 33 | + if (below) 34 | + below->next = c; 35 | + else 36 | + c->mon->clients = c; 37 | +} 38 | + 39 | void 40 | attachstack(Client *c) 41 | { 42 | @@ -1066,7 +1079,7 @@ manage(Window w, XWindowAttributes *wa) 43 | c->isfloating = c->oldstate = trans != None || c->isfixed; 44 | if (c->isfloating) 45 | XRaiseWindow(dpy, c->win); 46 | - attach(c); 47 | + attachbottom(c); 48 | attachstack(c); 49 | XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, 50 | (unsigned char *) &(c->win), 1); 51 | @@ -1421,7 +1434,7 @@ sendmon(Client *c, Monitor *m) 52 | detachstack(c); 53 | c->mon = m; 54 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 55 | - attach(c); 56 | + attachbottom(c); 57 | attachstack(c); 58 | focus(NULL); 59 | arrange(NULL); 60 | @@ -1903,7 +1916,7 @@ updategeom(void) 61 | m->clients = c->next; 62 | detachstack(c); 63 | c->mon = mons; 64 | - attach(c); 65 | + attachbottom(c); 66 | attachstack(c); 67 | } 68 | if (m == selmon) 69 | -- 70 | 2.45.2 71 | 72 | -------------------------------------------------------------------------------- /dwm/dwm-statuspadding-6.2.diff: -------------------------------------------------------------------------------- 1 | From a2a33f7009624af06bc691464307cb179ea87ed2 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 23:07:01 +0200 4 | Subject: [PATCH] Adding statuspadding patch 5 | 6 | Refer to: 7 | https://dwm.suckless.org/patches/statuspadding/ 8 | --- 9 | config.def.h | 2 ++ 10 | dwm.c | 8 ++++---- 11 | 2 files changed, 6 insertions(+), 4 deletions(-) 12 | 13 | diff --git a/config.def.h b/config.def.h 14 | index 1c0b587..ea4c3fd 100644 15 | --- a/config.def.h 16 | +++ b/config.def.h 17 | @@ -5,6 +5,8 @@ static const unsigned int borderpx = 1; /* border pixel of windows */ 18 | static const unsigned int snap = 32; /* snap pixel */ 19 | static const int showbar = 1; /* 0 means no bar */ 20 | static const int topbar = 1; /* 0 means bottom bar */ 21 | +static const int horizpadbar = 2; /* horizontal padding for statusbar */ 22 | +static const int vertpadbar = 0; /* vertical padding for statusbar */ 23 | static const char *fonts[] = { "monospace:size=10" }; 24 | static const char dmenufont[] = "monospace:size=10"; 25 | static const char col_gray1[] = "#222222"; 26 | diff --git a/dwm.c b/dwm.c 27 | index 4465af1..35e8275 100644 28 | --- a/dwm.c 29 | +++ b/dwm.c 30 | @@ -704,8 +704,8 @@ drawbar(Monitor *m) 31 | /* draw status first so it can be overdrawn by tags later */ 32 | if (m == selmon) { /* status is only drawn on selected monitor */ 33 | drw_setscheme(drw, scheme[SchemeNorm]); 34 | - sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ 35 | - drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0); 36 | + sw = TEXTW(stext); 37 | + drw_text(drw, m->ww - sw, 0, sw, bh, lrpad / 2, stext, 0); 38 | } 39 | 40 | for (c = m->clients; c; c = c->next) { 41 | @@ -1544,8 +1544,8 @@ setup(void) 42 | drw = drw_create(dpy, screen, root, sw, sh); 43 | if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) 44 | die("no fonts could be loaded."); 45 | - lrpad = drw->fonts->h; 46 | - bh = drw->fonts->h + 2; 47 | + lrpad = drw->fonts->h + horizpadbar; 48 | + bh = drw->fonts->h + vertpadbar; 49 | updategeom(); 50 | /* init atoms */ 51 | utf8string = XInternAtom(dpy, "UTF8_STRING", False); 52 | -- 53 | 2.45.2 54 | 55 | -------------------------------------------------------------------------------- /dwm/dwm-statuspadding-6.3.diff: -------------------------------------------------------------------------------- 1 | From 095f97e8e03b6b7f72b001b51a4d4bd3ef72ca92 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 23:07:20 +0200 4 | Subject: [PATCH] Adding statuspadding patch 5 | 6 | Refer to: 7 | https://dwm.suckless.org/patches/statuspadding/ 8 | --- 9 | config.def.h | 2 ++ 10 | dwm.c | 8 ++++---- 11 | 2 files changed, 6 insertions(+), 4 deletions(-) 12 | 13 | diff --git a/config.def.h b/config.def.h 14 | index a2ac963..6cb845c 100644 15 | --- a/config.def.h 16 | +++ b/config.def.h 17 | @@ -5,6 +5,8 @@ static const unsigned int borderpx = 1; /* border pixel of windows */ 18 | static const unsigned int snap = 32; /* snap pixel */ 19 | static const int showbar = 1; /* 0 means no bar */ 20 | static const int topbar = 1; /* 0 means bottom bar */ 21 | +static const int horizpadbar = 2; /* horizontal padding for statusbar */ 22 | +static const int vertpadbar = 0; /* vertical padding for statusbar */ 23 | static const char *fonts[] = { "monospace:size=10" }; 24 | static const char dmenufont[] = "monospace:size=10"; 25 | static const char col_gray1[] = "#222222"; 26 | diff --git a/dwm.c b/dwm.c 27 | index a96f33c..a1b8c95 100644 28 | --- a/dwm.c 29 | +++ b/dwm.c 30 | @@ -708,8 +708,8 @@ drawbar(Monitor *m) 31 | /* draw status first so it can be overdrawn by tags later */ 32 | if (m == selmon) { /* status is only drawn on selected monitor */ 33 | drw_setscheme(drw, scheme[SchemeNorm]); 34 | - tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ 35 | - drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0); 36 | + tw = TEXTW(stext); 37 | + drw_text(drw, m->ww - tw, 0, tw, bh, lrpad / 2, stext, 0); 38 | } 39 | 40 | for (c = m->clients; c; c = c->next) { 41 | @@ -1548,8 +1548,8 @@ setup(void) 42 | drw = drw_create(dpy, screen, root, sw, sh); 43 | if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) 44 | die("no fonts could be loaded."); 45 | - lrpad = drw->fonts->h; 46 | - bh = drw->fonts->h + 2; 47 | + lrpad = drw->fonts->h + horizpadbar; 48 | + bh = drw->fonts->h + vertpadbar; 49 | updategeom(); 50 | /* init atoms */ 51 | utf8string = XInternAtom(dpy, "UTF8_STRING", False); 52 | -- 53 | 2.45.2 54 | 55 | -------------------------------------------------------------------------------- /dmenu/dmenu-barpadding-5.3.diff: -------------------------------------------------------------------------------- 1 | From dfc9dd2553999b10dc45d4d678452b5e5324dc90 Mon Sep 17 00:00:00 2001 2 | From: bakkeby 3 | Date: Sun, 20 Mar 2022 15:26:13 +0100 4 | Subject: [PATCH] Adding barpadding patch for dmenu 5 | 6 | --- 7 | config.def.h | 3 +++ 8 | dmenu.c | 7 ++++++- 9 | 2 files changed, 9 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/config.def.h b/config.def.h 12 | index 1edb647..4251c09 100644 13 | --- a/config.def.h 14 | +++ b/config.def.h 15 | @@ -2,6 +2,9 @@ 16 | /* Default settings; can be overriden by command line. */ 17 | 18 | static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ 19 | +static const int vertpad = 10; /* vertical padding of bar */ 20 | +static const int sidepad = 10; /* horizontal padding of bar */ 21 | + 22 | /* -fn option overrides fonts[0]; default X11 font or font set */ 23 | static const char *fonts[] = { 24 | "monospace:size=10" 25 | diff --git a/dmenu.c b/dmenu.c 26 | index 40f93e0..f75c480 100644 27 | --- a/dmenu.c 28 | +++ b/dmenu.c 29 | @@ -38,6 +38,8 @@ static char *embed; 30 | static int bh, mw, mh; 31 | static int inputw = 0, promptw; 32 | static int lrpad; /* sum of left and right padding */ 33 | +static int vp; /* vertical padding for bar */ 34 | +static int sp; /* side padding for bar */ 35 | static size_t cursor; 36 | static struct item *items = NULL; 37 | static struct item *matches, *matchend; 38 | @@ -684,7 +686,7 @@ setup(void) 39 | swa.override_redirect = True; 40 | swa.background_pixel = scheme[SchemeNorm][ColBg].pixel; 41 | swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask; 42 | - win = XCreateWindow(dpy, root, x, y, mw, mh, 0, 43 | + win = XCreateWindow(dpy, root, x + sp, y + vp, mw - 2 * sp, mh, 0, 44 | CopyFromParent, CopyFromParent, CopyFromParent, 45 | CWOverrideRedirect | CWBackPixel | CWEventMask, &swa); 46 | XSetClassHint(dpy, win, &ch); 47 | @@ -777,6 +779,9 @@ main(int argc, char *argv[]) 48 | die("no fonts could be loaded."); 49 | lrpad = drw->fonts->h; 50 | 51 | + sp = sidepad; 52 | + vp = (topbar == 1) ? vertpad : - vertpad; 53 | + 54 | #ifdef __OpenBSD__ 55 | if (pledge("stdio rpath", NULL) == -1) 56 | die("pledge"); 57 | -- 58 | 2.45.2 59 | 60 | -------------------------------------------------------------------------------- /dwm/dwm-warp-6.2.diff: -------------------------------------------------------------------------------- 1 | From d2482d55f2fe0a93ae65441cf3b2a6a340be446f Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:33:45 +0200 4 | Subject: [PATCH] Warp patch 5 | 6 | Warps the mouse cursor to the center of the currently 7 | focused window or screen when the mouse cursor is (a) on a different screen 8 | or (b) on top of a different window. 9 | 10 | If you are using barmodules then you may want to have a look at the warp function here: 11 | https://github.com/bakkeby/dwm-flexipatch/blob/master/patch/warp.c 12 | --- 13 | dwm.c | 26 ++++++++++++++++++++++++++ 14 | 1 file changed, 26 insertions(+) 15 | 16 | diff --git a/dwm.c b/dwm.c 17 | index 4465af1..6270438 100644 18 | --- a/dwm.c 19 | +++ b/dwm.c 20 | @@ -227,6 +227,7 @@ static void updatetitle(Client *c); 21 | static void updatewindowtype(Client *c); 22 | static void updatewmhints(Client *c); 23 | static void view(const Arg *arg); 24 | +static void warp(const Client *c); 25 | static Client *wintoclient(Window w); 26 | static Monitor *wintomon(Window w); 27 | static int xerror(Display *dpy, XErrorEvent *ee); 28 | @@ -827,6 +828,7 @@ focusmon(const Arg *arg) 29 | unfocus(selmon->sel, 0); 30 | selmon = m; 31 | focus(NULL); 32 | + warp(selmon->sel); 33 | } 34 | 35 | void 36 | @@ -1367,6 +1369,8 @@ restack(Monitor *m) 37 | } 38 | XSync(dpy, False); 39 | while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 40 | + if (m == selmon && (m->tagset[m->seltags] & m->sel->tags) && m->lt[m->sellt]->arrange != &monocle) 41 | + warp(m->sel); 42 | } 43 | 44 | void 45 | @@ -2044,6 +2048,28 @@ view(const Arg *arg) 46 | arrange(selmon); 47 | } 48 | 49 | +void 50 | +warp(const Client *c) 51 | +{ 52 | + int x, y; 53 | + 54 | + if (!c) { 55 | + XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->wx + selmon->ww / 2, selmon->wy + selmon->wh / 2); 56 | + return; 57 | + } 58 | + 59 | + if (!getrootptr(&x, &y) || 60 | + (x > c->x - c->bw && 61 | + y > c->y - c->bw && 62 | + x < c->x + c->w + c->bw*2 && 63 | + y < c->y + c->h + c->bw*2) || 64 | + (y > c->mon->by && y < c->mon->by + bh) || 65 | + (c->mon->topbar && !y)) 66 | + return; 67 | + 68 | + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2); 69 | +} 70 | + 71 | Client * 72 | wintoclient(Window w) 73 | { 74 | -- 75 | 2.45.2 76 | 77 | -------------------------------------------------------------------------------- /dwm/dwm-warp-6.3.diff: -------------------------------------------------------------------------------- 1 | From cc31e5167f59c073416cfb12b2f7955d4f08cd3a Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:34:57 +0200 4 | Subject: [PATCH] Warp patch 5 | 6 | Warps the mouse cursor to the center of the currently 7 | focused window or screen when the mouse cursor is (a) on a different screen 8 | or (b) on top of a different window. 9 | 10 | If you are using barmodules then you may want to have a look at the warp function here: 11 | https://github.com/bakkeby/dwm-flexipatch/blob/master/patch/warp.c 12 | --- 13 | dwm.c | 26 ++++++++++++++++++++++++++ 14 | 1 file changed, 26 insertions(+) 15 | 16 | diff --git a/dwm.c b/dwm.c 17 | index a96f33c..a20d778 100644 18 | --- a/dwm.c 19 | +++ b/dwm.c 20 | @@ -228,6 +228,7 @@ static void updatetitle(Client *c); 21 | static void updatewindowtype(Client *c); 22 | static void updatewmhints(Client *c); 23 | static void view(const Arg *arg); 24 | +static void warp(const Client *c); 25 | static Client *wintoclient(Window w); 26 | static Monitor *wintomon(Window w); 27 | static int xerror(Display *dpy, XErrorEvent *ee); 28 | @@ -831,6 +832,7 @@ focusmon(const Arg *arg) 29 | unfocus(selmon->sel, 0); 30 | selmon = m; 31 | focus(NULL); 32 | + warp(selmon->sel); 33 | } 34 | 35 | void 36 | @@ -1369,6 +1371,8 @@ restack(Monitor *m) 37 | wc.sibling = c->win; 38 | } 39 | } 40 | + if (m == selmon && (m->tagset[m->seltags] & m->sel->tags) && m->lt[m->sellt]->arrange != &monocle) 41 | + warp(m->sel); 42 | XSync(dpy, False); 43 | while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 44 | } 45 | @@ -2050,6 +2054,28 @@ view(const Arg *arg) 46 | arrange(selmon); 47 | } 48 | 49 | +void 50 | +warp(const Client *c) 51 | +{ 52 | + int x, y; 53 | + 54 | + if (!c) { 55 | + XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->wx + selmon->ww / 2, selmon->wy + selmon->wh / 2); 56 | + return; 57 | + } 58 | + 59 | + if (!getrootptr(&x, &y) || 60 | + (x > c->x - c->bw && 61 | + y > c->y - c->bw && 62 | + x < c->x + c->w + c->bw*2 && 63 | + y < c->y + c->h + c->bw*2) || 64 | + (y > c->mon->by && y < c->mon->by + bh) || 65 | + (c->mon->topbar && !y)) 66 | + return; 67 | + 68 | + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2); 69 | +} 70 | + 71 | Client * 72 | wintoclient(Window w) 73 | { 74 | -- 75 | 2.45.2 76 | 77 | -------------------------------------------------------------------------------- /dmenu/dmenu-barpadding-5.0_20210725_523aa08.diff: -------------------------------------------------------------------------------- 1 | From 0d3204f1f3f568e0e2e0d17423f7954db6ae3939 Mon Sep 17 00:00:00 2001 2 | From: bakkeby 3 | Date: Sun, 20 Mar 2022 15:26:13 +0100 4 | Subject: [PATCH] Adding barpadding patch for dmenu 5 | 6 | --- 7 | config.def.h | 3 +++ 8 | dmenu.c | 7 ++++++- 9 | 2 files changed, 9 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/config.def.h b/config.def.h 12 | index 1edb647..4251c09 100644 13 | --- a/config.def.h 14 | +++ b/config.def.h 15 | @@ -2,6 +2,9 @@ 16 | /* Default settings; can be overriden by command line. */ 17 | 18 | static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ 19 | +static const int vertpad = 10; /* vertical padding of bar */ 20 | +static const int sidepad = 10; /* horizontal padding of bar */ 21 | + 22 | /* -fn option overrides fonts[0]; default X11 font or font set */ 23 | static const char *fonts[] = { 24 | "monospace:size=10" 25 | diff --git a/dmenu.c b/dmenu.c 26 | index 65f25ce..2e1fb56 100644 27 | --- a/dmenu.c 28 | +++ b/dmenu.c 29 | @@ -39,6 +39,8 @@ static char *embed; 30 | static int bh, mw, mh; 31 | static int inputw = 0, promptw; 32 | static int lrpad; /* sum of left and right padding */ 33 | +static int vp; /* vertical padding for bar */ 34 | +static int sp; /* side padding for bar */ 35 | static size_t cursor; 36 | static struct item *items = NULL; 37 | static struct item *matches, *matchend; 38 | @@ -659,7 +661,7 @@ setup(void) 39 | swa.override_redirect = True; 40 | swa.background_pixel = scheme[SchemeNorm][ColBg].pixel; 41 | swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask; 42 | - win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0, 43 | + win = XCreateWindow(dpy, parentwin, x + sp, y + vp, mw - 2 * sp, mh, 0, 44 | CopyFromParent, CopyFromParent, CopyFromParent, 45 | CWOverrideRedirect | CWBackPixel | CWEventMask, &swa); 46 | XSetClassHint(dpy, win, &ch); 47 | @@ -752,6 +754,9 @@ main(int argc, char *argv[]) 48 | die("no fonts could be loaded."); 49 | lrpad = drw->fonts->h; 50 | 51 | + sp = sidepad; 52 | + vp = (topbar == 1) ? vertpad : - vertpad; 53 | + 54 | #ifdef __OpenBSD__ 55 | if (pledge("stdio rpath", NULL) == -1) 56 | die("pledge"); 57 | -- 58 | 2.35.1 59 | 60 | -------------------------------------------------------------------------------- /dwm/dwm-desktop_icons-6.2.diff: -------------------------------------------------------------------------------- 1 | From 42844408a25d72efbe34a02f3da6943c90168874 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 09:47:42 +0200 4 | Subject: [PATCH] desktop icons patch 5 | 6 | New windows that has the _NET_WM_WINDOW_TYPE_DESKTOP window type 7 | will not be managed by dwm. 8 | 9 | Example programs that this applies to: 10 | - pcmanfm --desktop 11 | - nautilus -n (legacy) 12 | - nemo-desktop 13 | - caja --force-desktop --no-default-window 14 | 15 | Note that these applications have a tendency of managing the 16 | background wallpaper as well, the exception being nemo-desktop 17 | where it appears to just be transparent if a compositor is used. 18 | --- 19 | dwm.c | 10 ++++++++++ 20 | 1 file changed, 10 insertions(+) 21 | 22 | diff --git a/dwm.c b/dwm.c 23 | index 4465af1..34a95ce 100644 24 | --- a/dwm.c 25 | +++ b/dwm.c 26 | @@ -62,6 +62,7 @@ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 27 | enum { SchemeNorm, SchemeSel }; /* color schemes */ 28 | enum { NetSupported, NetWMName, NetWMState, NetWMCheck, 29 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, 30 | + NetWMWindowTypeDesktop, 31 | NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ 32 | enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ 33 | enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, 34 | @@ -1023,6 +1024,14 @@ manage(Window w, XWindowAttributes *wa) 35 | 36 | c = ecalloc(1, sizeof(Client)); 37 | c->win = w; 38 | + 39 | + if (getatomprop(c, netatom[NetWMWindowType]) == netatom[NetWMWindowTypeDesktop]) { 40 | + XMapWindow(dpy, c->win); 41 | + XLowerWindow(dpy, c->win); 42 | + free(c); 43 | + return; 44 | + } 45 | + 46 | /* geometry */ 47 | c->x = c->oldx = wa->x; 48 | c->y = c->oldy = wa->y; 49 | @@ -1561,6 +1570,7 @@ setup(void) 50 | netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); 51 | netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); 52 | netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); 53 | + netatom[NetWMWindowTypeDesktop] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DESKTOP", False); 54 | netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); 55 | /* init cursors */ 56 | cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); 57 | -- 58 | 2.45.2 59 | 60 | -------------------------------------------------------------------------------- /dwm/dwm-desktop_icons-6.3.diff: -------------------------------------------------------------------------------- 1 | From 456412809dbe8c91879c1e01d213e3258130c2b1 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 09:50:22 +0200 4 | Subject: [PATCH] desktop icons patch 5 | 6 | New windows that has the _NET_WM_WINDOW_TYPE_DESKTOP window type 7 | will not be managed by dwm. 8 | 9 | Example programs that this applies to: 10 | - pcmanfm --desktop 11 | - nautilus -n (legacy) 12 | - nemo-desktop 13 | - caja --force-desktop --no-default-window 14 | 15 | Note that these applications have a tendency of managing the 16 | background wallpaper as well, the exception being nemo-desktop 17 | where it appears to just be transparent if a compositor is used. 18 | --- 19 | dwm.c | 10 ++++++++++ 20 | 1 file changed, 10 insertions(+) 21 | 22 | diff --git a/dwm.c b/dwm.c 23 | index a96f33c..efe966f 100644 24 | --- a/dwm.c 25 | +++ b/dwm.c 26 | @@ -62,6 +62,7 @@ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 27 | enum { SchemeNorm, SchemeSel }; /* color schemes */ 28 | enum { NetSupported, NetWMName, NetWMState, NetWMCheck, 29 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, 30 | + NetWMWindowTypeDesktop, 31 | NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ 32 | enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ 33 | enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, 34 | @@ -1027,6 +1028,14 @@ manage(Window w, XWindowAttributes *wa) 35 | 36 | c = ecalloc(1, sizeof(Client)); 37 | c->win = w; 38 | + 39 | + if (getatomprop(c, netatom[NetWMWindowType]) == netatom[NetWMWindowTypeDesktop]) { 40 | + XMapWindow(dpy, c->win); 41 | + XLowerWindow(dpy, c->win); 42 | + free(c); 43 | + return; 44 | + } 45 | + 46 | /* geometry */ 47 | c->x = c->oldx = wa->x; 48 | c->y = c->oldy = wa->y; 49 | @@ -1565,6 +1574,7 @@ setup(void) 50 | netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); 51 | netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); 52 | netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); 53 | + netatom[NetWMWindowTypeDesktop] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DESKTOP", False); 54 | netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); 55 | /* init cursors */ 56 | cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); 57 | -- 58 | 2.45.2 59 | 60 | -------------------------------------------------------------------------------- /dwm/dwm-desktop_icons-6.5.diff: -------------------------------------------------------------------------------- 1 | From e6b3d027d7d2ec52c39557110cef0af32a156d0d Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 09:50:22 +0200 4 | Subject: [PATCH] desktop icons patch 5 | 6 | New windows that has the _NET_WM_WINDOW_TYPE_DESKTOP window type 7 | will not be managed by dwm. 8 | 9 | Example programs that this applies to: 10 | - pcmanfm --desktop 11 | - nautilus -n (legacy) 12 | - nemo-desktop 13 | - caja --force-desktop --no-default-window 14 | 15 | Note that these applications have a tendency of managing the 16 | background wallpaper as well, the exception being nemo-desktop 17 | where it appears to just be transparent if a compositor is used. 18 | --- 19 | dwm.c | 10 ++++++++++ 20 | 1 file changed, 10 insertions(+) 21 | 22 | diff --git a/dwm.c b/dwm.c 23 | index f1d86b2..47ef45e 100644 24 | --- a/dwm.c 25 | +++ b/dwm.c 26 | @@ -62,6 +62,7 @@ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 27 | enum { SchemeNorm, SchemeSel }; /* color schemes */ 28 | enum { NetSupported, NetWMName, NetWMState, NetWMCheck, 29 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, 30 | + NetWMWindowTypeDesktop, 31 | NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ 32 | enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ 33 | enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, 34 | @@ -1037,6 +1038,14 @@ manage(Window w, XWindowAttributes *wa) 35 | 36 | c = ecalloc(1, sizeof(Client)); 37 | c->win = w; 38 | + 39 | + if (getatomprop(c, netatom[NetWMWindowType]) == netatom[NetWMWindowTypeDesktop]) { 40 | + XMapWindow(dpy, c->win); 41 | + XLowerWindow(dpy, c->win); 42 | + free(c); 43 | + return; 44 | + } 45 | + 46 | /* geometry */ 47 | c->x = c->oldx = wa->x; 48 | c->y = c->oldy = wa->y; 49 | @@ -1578,6 +1587,7 @@ setup(void) 50 | netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); 51 | netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); 52 | netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); 53 | + netatom[NetWMWindowTypeDesktop] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DESKTOP", False); 54 | netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); 55 | /* init cursors */ 56 | cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); 57 | -- 58 | 2.45.2 59 | 60 | -------------------------------------------------------------------------------- /dwm/dwm-desktop_icons-6.6.diff: -------------------------------------------------------------------------------- 1 | From f3f22ba0aaba049f9f53f5672f5216364611f135 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 09:50:22 +0200 4 | Subject: [PATCH] desktop icons patch 5 | 6 | New windows that has the _NET_WM_WINDOW_TYPE_DESKTOP window type 7 | will not be managed by dwm. 8 | 9 | Example programs that this applies to: 10 | - pcmanfm --desktop 11 | - nautilus -n (legacy) 12 | - nemo-desktop 13 | - caja --force-desktop --no-default-window 14 | 15 | Note that these applications have a tendency of managing the 16 | background wallpaper as well, the exception being nemo-desktop 17 | where it appears to just be transparent if a compositor is used. 18 | --- 19 | dwm.c | 10 ++++++++++ 20 | 1 file changed, 10 insertions(+) 21 | 22 | diff --git a/dwm.c b/dwm.c 23 | index 1443802..aca99fb 100644 24 | --- a/dwm.c 25 | +++ b/dwm.c 26 | @@ -61,6 +61,7 @@ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 27 | enum { SchemeNorm, SchemeSel }; /* color schemes */ 28 | enum { NetSupported, NetWMName, NetWMState, NetWMCheck, 29 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, 30 | + NetWMWindowTypeDesktop, 31 | NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ 32 | enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ 33 | enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, 34 | @@ -1036,6 +1037,14 @@ manage(Window w, XWindowAttributes *wa) 35 | 36 | c = ecalloc(1, sizeof(Client)); 37 | c->win = w; 38 | + 39 | + if (getatomprop(c, netatom[NetWMWindowType]) == netatom[NetWMWindowTypeDesktop]) { 40 | + XMapWindow(dpy, c->win); 41 | + XLowerWindow(dpy, c->win); 42 | + free(c); 43 | + return; 44 | + } 45 | + 46 | /* geometry */ 47 | c->x = c->oldx = wa->x; 48 | c->y = c->oldy = wa->y; 49 | @@ -1577,6 +1586,7 @@ setup(void) 50 | netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); 51 | netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); 52 | netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); 53 | + netatom[NetWMWindowTypeDesktop] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DESKTOP", False); 54 | netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); 55 | /* init cursors */ 56 | cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); 57 | -- 58 | 2.50.1 59 | 60 | -------------------------------------------------------------------------------- /dwm/dwm-steam-6.2.diff: -------------------------------------------------------------------------------- 1 | From 2487d4bca375401df3713dd5c627a2be7a08e316 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 23:06:16 +0200 4 | Subject: [PATCH] Steam patch 5 | 6 | Steam, and steam windows (games), trigger a ConfigureNotify request every time the window 7 | gets focus. More so, the configure event passed along from Steam tends to have the wrong 8 | x and y co-ordinates which can make the window, if floating, jump around the screen. 9 | 10 | This patch works around this age-old issue by ignoring the x and y co-ordinates for 11 | ConfigureNotify requests relating to Steam windows. 12 | --- 13 | dwm.c | 22 +++++++++++++++------- 14 | 1 file changed, 15 insertions(+), 7 deletions(-) 15 | 16 | diff --git a/dwm.c b/dwm.c 17 | index 4465af1..e758060 100644 18 | --- a/dwm.c 19 | +++ b/dwm.c 20 | @@ -93,6 +93,7 @@ struct Client { 21 | int bw, oldbw; 22 | unsigned int tags; 23 | int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 24 | + int issteam; 25 | Client *next; 26 | Client *snext; 27 | Monitor *mon; 28 | @@ -291,6 +292,9 @@ applyrules(Client *c) 29 | class = ch.res_class ? ch.res_class : broken; 30 | instance = ch.res_name ? ch.res_name : broken; 31 | 32 | + if (strstr(class, "Steam") || strstr(class, "steam_app_")) 33 | + c->issteam = 1; 34 | + 35 | for (i = 0; i < LENGTH(rules); i++) { 36 | r = &rules[i]; 37 | if ((!r->title || strstr(c->name, r->title)) 38 | @@ -588,13 +592,15 @@ configurerequest(XEvent *e) 39 | c->bw = ev->border_width; 40 | else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) { 41 | m = c->mon; 42 | - if (ev->value_mask & CWX) { 43 | - c->oldx = c->x; 44 | - c->x = m->mx + ev->x; 45 | - } 46 | - if (ev->value_mask & CWY) { 47 | - c->oldy = c->y; 48 | - c->y = m->my + ev->y; 49 | + if (!c->issteam) { 50 | + if (ev->value_mask & CWX) { 51 | + c->oldx = c->x; 52 | + c->x = m->mx + ev->x; 53 | + } 54 | + if (ev->value_mask & CWY) { 55 | + c->oldy = c->y; 56 | + c->y = m->my + ev->y; 57 | + } 58 | } 59 | if (ev->value_mask & CWWidth) { 60 | c->oldw = c->w; 61 | @@ -1466,6 +1472,8 @@ setfocus(Client *c) 62 | XA_WINDOW, 32, PropModeReplace, 63 | (unsigned char *) &(c->win), 1); 64 | } 65 | + if (c->issteam) 66 | + setclientstate(c, NormalState); 67 | sendevent(c, wmatom[WMTakeFocus]); 68 | } 69 | 70 | -- 71 | 2.45.2 72 | 73 | -------------------------------------------------------------------------------- /dwm/dwm-steam-6.3.diff: -------------------------------------------------------------------------------- 1 | From a23386165c6551c63dd28aa2dd5deebb734dfd11 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 23:06:37 +0200 4 | Subject: [PATCH] Steam patch 5 | 6 | Steam, and steam windows (games), trigger a ConfigureNotify request every time the window 7 | gets focus. More so, the configure event passed along from Steam tends to have the wrong 8 | x and y co-ordinates which can make the window, if floating, jump around the screen. 9 | 10 | This patch works around this age-old issue by ignoring the x and y co-ordinates for 11 | ConfigureNotify requests relating to Steam windows. 12 | --- 13 | dwm.c | 22 +++++++++++++++------- 14 | 1 file changed, 15 insertions(+), 7 deletions(-) 15 | 16 | diff --git a/dwm.c b/dwm.c 17 | index a96f33c..318491b 100644 18 | --- a/dwm.c 19 | +++ b/dwm.c 20 | @@ -93,6 +93,7 @@ struct Client { 21 | int bw, oldbw; 22 | unsigned int tags; 23 | int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 24 | + int issteam; 25 | Client *next; 26 | Client *snext; 27 | Monitor *mon; 28 | @@ -292,6 +293,9 @@ applyrules(Client *c) 29 | class = ch.res_class ? ch.res_class : broken; 30 | instance = ch.res_name ? ch.res_name : broken; 31 | 32 | + if (strstr(class, "Steam") || strstr(class, "steam_app_")) 33 | + c->issteam = 1; 34 | + 35 | for (i = 0; i < LENGTH(rules); i++) { 36 | r = &rules[i]; 37 | if ((!r->title || strstr(c->name, r->title)) 38 | @@ -589,13 +593,15 @@ configurerequest(XEvent *e) 39 | c->bw = ev->border_width; 40 | else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) { 41 | m = c->mon; 42 | - if (ev->value_mask & CWX) { 43 | - c->oldx = c->x; 44 | - c->x = m->mx + ev->x; 45 | - } 46 | - if (ev->value_mask & CWY) { 47 | - c->oldy = c->y; 48 | - c->y = m->my + ev->y; 49 | + if (!c->issteam) { 50 | + if (ev->value_mask & CWX) { 51 | + c->oldx = c->x; 52 | + c->x = m->mx + ev->x; 53 | + } 54 | + if (ev->value_mask & CWY) { 55 | + c->oldy = c->y; 56 | + c->y = m->my + ev->y; 57 | + } 58 | } 59 | if (ev->value_mask & CWWidth) { 60 | c->oldw = c->w; 61 | @@ -1470,6 +1476,8 @@ setfocus(Client *c) 62 | XA_WINDOW, 32, PropModeReplace, 63 | (unsigned char *) &(c->win), 1); 64 | } 65 | + if (c->issteam) 66 | + setclientstate(c, NormalState); 67 | sendevent(c, wmatom[WMTakeFocus]); 68 | } 69 | 70 | -- 71 | 2.45.2 72 | 73 | -------------------------------------------------------------------------------- /dwm/dwm-steam-6.5.diff: -------------------------------------------------------------------------------- 1 | From f202a25a5c72ac69790053f8155d169e0f59e42f Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 23:06:37 +0200 4 | Subject: [PATCH] Steam patch 5 | 6 | Steam, and steam windows (games), trigger a ConfigureNotify request every time the window 7 | gets focus. More so, the configure event passed along from Steam tends to have the wrong 8 | x and y co-ordinates which can make the window, if floating, jump around the screen. 9 | 10 | This patch works around this age-old issue by ignoring the x and y co-ordinates for 11 | ConfigureNotify requests relating to Steam windows. 12 | --- 13 | dwm.c | 22 +++++++++++++++------- 14 | 1 file changed, 15 insertions(+), 7 deletions(-) 15 | 16 | diff --git a/dwm.c b/dwm.c 17 | index f1d86b2..874dc3c 100644 18 | --- a/dwm.c 19 | +++ b/dwm.c 20 | @@ -93,6 +93,7 @@ struct Client { 21 | int bw, oldbw; 22 | unsigned int tags; 23 | int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 24 | + int issteam; 25 | Client *next; 26 | Client *snext; 27 | Monitor *mon; 28 | @@ -291,6 +292,9 @@ applyrules(Client *c) 29 | class = ch.res_class ? ch.res_class : broken; 30 | instance = ch.res_name ? ch.res_name : broken; 31 | 32 | + if (strstr(class, "Steam") || strstr(class, "steam_app_")) 33 | + c->issteam = 1; 34 | + 35 | for (i = 0; i < LENGTH(rules); i++) { 36 | r = &rules[i]; 37 | if ((!r->title || strstr(c->name, r->title)) 38 | @@ -591,13 +595,15 @@ configurerequest(XEvent *e) 39 | c->bw = ev->border_width; 40 | else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) { 41 | m = c->mon; 42 | - if (ev->value_mask & CWX) { 43 | - c->oldx = c->x; 44 | - c->x = m->mx + ev->x; 45 | - } 46 | - if (ev->value_mask & CWY) { 47 | - c->oldy = c->y; 48 | - c->y = m->my + ev->y; 49 | + if (!c->issteam) { 50 | + if (ev->value_mask & CWX) { 51 | + c->oldx = c->x; 52 | + c->x = m->mx + ev->x; 53 | + } 54 | + if (ev->value_mask & CWY) { 55 | + c->oldy = c->y; 56 | + c->y = m->my + ev->y; 57 | + } 58 | } 59 | if (ev->value_mask & CWWidth) { 60 | c->oldw = c->w; 61 | @@ -1476,6 +1482,8 @@ setfocus(Client *c) 62 | XA_WINDOW, 32, PropModeReplace, 63 | (unsigned char *) &(c->win), 1); 64 | } 65 | + if (c->issteam) 66 | + setclientstate(c, NormalState); 67 | sendevent(c, wmatom[WMTakeFocus]); 68 | } 69 | 70 | -- 71 | 2.45.2 72 | 73 | -------------------------------------------------------------------------------- /dwm/dwm-steam-6.6.diff: -------------------------------------------------------------------------------- 1 | From df7d9a685f38b64b8087faa3c72f05acf0190383 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 23:06:37 +0200 4 | Subject: [PATCH] Steam patch 5 | 6 | Steam, and steam windows (games), trigger a ConfigureNotify request every time the window 7 | gets focus. More so, the configure event passed along from Steam tends to have the wrong 8 | x and y co-ordinates which can make the window, if floating, jump around the screen. 9 | 10 | This patch works around this age-old issue by ignoring the x and y co-ordinates for 11 | ConfigureNotify requests relating to Steam windows. 12 | --- 13 | dwm.c | 22 +++++++++++++++------- 14 | 1 file changed, 15 insertions(+), 7 deletions(-) 15 | 16 | diff --git a/dwm.c b/dwm.c 17 | index 1443802..d99a6fb 100644 18 | --- a/dwm.c 19 | +++ b/dwm.c 20 | @@ -92,6 +92,7 @@ struct Client { 21 | int bw, oldbw; 22 | unsigned int tags; 23 | int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 24 | + int issteam; 25 | Client *next; 26 | Client *snext; 27 | Monitor *mon; 28 | @@ -290,6 +291,9 @@ applyrules(Client *c) 29 | class = ch.res_class ? ch.res_class : broken; 30 | instance = ch.res_name ? ch.res_name : broken; 31 | 32 | + if (strstr(class, "Steam") || strstr(class, "steam_app_")) 33 | + c->issteam = 1; 34 | + 35 | for (i = 0; i < LENGTH(rules); i++) { 36 | r = &rules[i]; 37 | if ((!r->title || strstr(c->name, r->title)) 38 | @@ -590,13 +594,15 @@ configurerequest(XEvent *e) 39 | c->bw = ev->border_width; 40 | else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) { 41 | m = c->mon; 42 | - if (ev->value_mask & CWX) { 43 | - c->oldx = c->x; 44 | - c->x = m->mx + ev->x; 45 | - } 46 | - if (ev->value_mask & CWY) { 47 | - c->oldy = c->y; 48 | - c->y = m->my + ev->y; 49 | + if (!c->issteam) { 50 | + if (ev->value_mask & CWX) { 51 | + c->oldx = c->x; 52 | + c->x = m->mx + ev->x; 53 | + } 54 | + if (ev->value_mask & CWY) { 55 | + c->oldy = c->y; 56 | + c->y = m->my + ev->y; 57 | + } 58 | } 59 | if (ev->value_mask & CWWidth) { 60 | c->oldw = c->w; 61 | @@ -1475,6 +1481,8 @@ setfocus(Client *c) 62 | XA_WINDOW, 32, PropModeReplace, 63 | (unsigned char *) &(c->win), 1); 64 | } 65 | + if (c->issteam) 66 | + setclientstate(c, NormalState); 67 | sendevent(c, wmatom[WMTakeFocus]); 68 | } 69 | 70 | -- 71 | 2.50.1 72 | 73 | -------------------------------------------------------------------------------- /dwm/dwm-centeredsizehints-6.5.diff: -------------------------------------------------------------------------------- 1 | From 9566bc1d2766125b8cfd6a7ad2874f0e4d3c31c6 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 24 Jun 2024 16:03:31 +0200 4 | Subject: [PATCH] Center clients within their allocated tile based on size 5 | hints 6 | 7 | --- 8 | dwm.c | 29 +++++++++++++++++++++++++---- 9 | 1 file changed, 25 insertions(+), 4 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index f1d86b2..bed044b 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -191,6 +191,7 @@ static void quit(const Arg *arg); 16 | static Monitor *recttomon(int x, int y, int w, int h); 17 | static void resize(Client *c, int x, int y, int w, int h, int interact); 18 | static void resizeclient(Client *c, int x, int y, int w, int h); 19 | +static void resizeclientpad(Client *c, int x, int y, int w, int h, int xpad, int ypad); 20 | static void resizemouse(const Arg *arg); 21 | static void restack(Monitor *m); 22 | static void run(void); 23 | @@ -1276,21 +1277,41 @@ recttomon(int x, int y, int w, int h) 24 | } 25 | 26 | void 27 | -resize(Client *c, int x, int y, int w, int h, int interact) 28 | +resize(Client *c, int tx, int ty, int tw, int th, int interact) 29 | { 30 | - if (applysizehints(c, &x, &y, &w, &h, interact)) 31 | - resizeclient(c, x, y, w, h); 32 | + int wh = tw, hh = th; 33 | + if (applysizehints(c, &tx, &ty, &wh, &hh, interact)) 34 | + resizeclientpad(c, tx, ty, wh, hh, tw, th); 35 | } 36 | 37 | +/* This wrapper is just for compatibility with other patches that may call resizeclient */ 38 | void 39 | resizeclient(Client *c, int x, int y, int w, int h) 40 | { 41 | - XWindowChanges wc; 42 | + resizeclientpad(c, x, y, w, h, w, h); 43 | +} 44 | 45 | +/* This is essentially the resizeclient function renamed with two 46 | + * additional parameters, tw and th (for tile width and height). */ 47 | +void 48 | +resizeclientpad(Client *c, int x, int y, int w, int h, int tw, int th) 49 | +{ 50 | + XWindowChanges wc; 51 | c->oldx = c->x; c->x = wc.x = x; 52 | c->oldy = c->y; c->y = wc.y = y; 53 | c->oldw = c->w; c->w = wc.width = w; 54 | c->oldh = c->h; c->h = wc.height = h; 55 | + if (!c->isfloating) { 56 | + if (w != tw) { 57 | + wc.x += (tw - w) / 2; 58 | + c->w = tw; 59 | + } 60 | + if (h != th) { 61 | + wc.y += (th - h) / 2; 62 | + c->h = th; 63 | + } 64 | + } 65 | + 66 | wc.border_width = c->bw; 67 | XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); 68 | configure(c); 69 | -- 70 | 2.45.2 71 | 72 | -------------------------------------------------------------------------------- /dwm/dwm-centeredsizehints-6.6.diff: -------------------------------------------------------------------------------- 1 | From a1bec1cc67b4f76406fbec0cc5a47da0148309c0 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 24 Jun 2024 16:03:31 +0200 4 | Subject: [PATCH] Center clients within their allocated tile based on size 5 | hints 6 | 7 | --- 8 | dwm.c | 29 +++++++++++++++++++++++++---- 9 | 1 file changed, 25 insertions(+), 4 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index 1443802..adae958 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -190,6 +190,7 @@ static void quit(const Arg *arg); 16 | static Monitor *recttomon(int x, int y, int w, int h); 17 | static void resize(Client *c, int x, int y, int w, int h, int interact); 18 | static void resizeclient(Client *c, int x, int y, int w, int h); 19 | +static void resizeclientpad(Client *c, int x, int y, int w, int h, int xpad, int ypad); 20 | static void resizemouse(const Arg *arg); 21 | static void restack(Monitor *m); 22 | static void run(void); 23 | @@ -1275,21 +1276,41 @@ recttomon(int x, int y, int w, int h) 24 | } 25 | 26 | void 27 | -resize(Client *c, int x, int y, int w, int h, int interact) 28 | +resize(Client *c, int tx, int ty, int tw, int th, int interact) 29 | { 30 | - if (applysizehints(c, &x, &y, &w, &h, interact)) 31 | - resizeclient(c, x, y, w, h); 32 | + int wh = tw, hh = th; 33 | + if (applysizehints(c, &tx, &ty, &wh, &hh, interact)) 34 | + resizeclientpad(c, tx, ty, wh, hh, tw, th); 35 | } 36 | 37 | +/* This wrapper is just for compatibility with other patches that may call resizeclient */ 38 | void 39 | resizeclient(Client *c, int x, int y, int w, int h) 40 | { 41 | - XWindowChanges wc; 42 | + resizeclientpad(c, x, y, w, h, w, h); 43 | +} 44 | 45 | +/* This is essentially the resizeclient function renamed with two 46 | + * additional parameters, tw and th (for tile width and height). */ 47 | +void 48 | +resizeclientpad(Client *c, int x, int y, int w, int h, int tw, int th) 49 | +{ 50 | + XWindowChanges wc; 51 | c->oldx = c->x; c->x = wc.x = x; 52 | c->oldy = c->y; c->y = wc.y = y; 53 | c->oldw = c->w; c->w = wc.width = w; 54 | c->oldh = c->h; c->h = wc.height = h; 55 | + if (!c->isfloating) { 56 | + if (w != tw) { 57 | + wc.x += (tw - w) / 2; 58 | + c->w = tw; 59 | + } 60 | + if (h != th) { 61 | + wc.y += (th - h) / 2; 62 | + c->h = th; 63 | + } 64 | + } 65 | + 66 | wc.border_width = c->bw; 67 | XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); 68 | configure(c); 69 | -- 70 | 2.50.1 71 | 72 | -------------------------------------------------------------------------------- /dwm/dwm-losefullscreen-6.2.orig.diff: -------------------------------------------------------------------------------- 1 | From b0f56cb0228afc5bda80ea233d1cffe1a19f292f Mon Sep 17 00:00:00 2001 2 | From: bakkeby 3 | Date: Tue, 7 Apr 2020 11:40:30 +0200 4 | Subject: [PATCH] Lose fullscreen on focus change 5 | 6 | --- 7 | dwm.c | 20 ++++++++++++++------ 8 | 1 file changed, 14 insertions(+), 6 deletions(-) 9 | 10 | diff --git a/dwm.c b/dwm.c 11 | index 4465af1..a300ba0 100644 12 | --- a/dwm.c 13 | +++ b/dwm.c 14 | @@ -418,15 +418,16 @@ buttonpress(XEvent *e) 15 | { 16 | unsigned int i, x, click; 17 | Arg arg = {0}; 18 | - Client *c; 19 | + Client *c, *sel; 20 | Monitor *m; 21 | XButtonPressedEvent *ev = &e->xbutton; 22 | 23 | click = ClkRootWin; 24 | /* focus monitor if necessary */ 25 | if ((m = wintomon(ev->window)) && m != selmon) { 26 | - unfocus(selmon->sel, 1); 27 | + sel = selmon->sel; 28 | selmon = m; 29 | + unfocus(sel, 1); 30 | focus(NULL); 31 | } 32 | if (ev->window == selmon->barwin) { 33 | @@ -754,7 +755,7 @@ drawbars(void) 34 | void 35 | enternotify(XEvent *e) 36 | { 37 | - Client *c; 38 | + Client *c, *sel; 39 | Monitor *m; 40 | XCrossingEvent *ev = &e->xcrossing; 41 | 42 | @@ -763,8 +764,9 @@ enternotify(XEvent *e) 43 | c = wintoclient(ev->window); 44 | m = c ? c->mon : wintomon(ev->window); 45 | if (m != selmon) { 46 | - unfocus(selmon->sel, 1); 47 | + sel = selmon->sel; 48 | selmon = m; 49 | + unfocus(sel, 1); 50 | } else if (!c || c == selmon->sel) 51 | return; 52 | focus(c); 53 | @@ -819,13 +821,15 @@ void 54 | focusmon(const Arg *arg) 55 | { 56 | Monitor *m; 57 | + Client *sel; 58 | 59 | if (!mons->next) 60 | return; 61 | if ((m = dirtomon(arg->i)) == selmon) 62 | return; 63 | - unfocus(selmon->sel, 0); 64 | + sel = selmon->sel; 65 | selmon = m; 66 | + unfocus(sel, 0); 67 | focus(NULL); 68 | } 69 | 70 | @@ -1120,13 +1124,15 @@ motionnotify(XEvent *e) 71 | { 72 | static Monitor *mon = NULL; 73 | Monitor *m; 74 | + Client *sel; 75 | XMotionEvent *ev = &e->xmotion; 76 | 77 | if (ev->window != root) 78 | return; 79 | if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) { 80 | - unfocus(selmon->sel, 1); 81 | + sel = selmon->sel; 82 | selmon = m; 83 | + unfocus(sel, 1); 84 | focus(NULL); 85 | } 86 | mon = m; 87 | @@ -1751,6 +1757,8 @@ unfocus(Client *c, int setfocus) 88 | { 89 | if (!c) 90 | return; 91 | + if (c->isfullscreen && ISVISIBLE(c) && c->mon == selmon) 92 | + setfullscreen(c, 0); 93 | grabbuttons(c, 0); 94 | XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); 95 | if (setfocus) { 96 | -- 97 | 2.19.1 98 | 99 | -------------------------------------------------------------------------------- /dwm/dwm-zero_depth_safeguard-6.2.diff: -------------------------------------------------------------------------------- 1 | From a7464dd97e3ff6f9d7ec39dc31e576a689867332 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:33:03 +0200 4 | Subject: [PATCH] Zero depth safeguard for dwm 5 | 6 | The colour depth attribute of an X window represents the number of bits 7 | that are used to represent the colour. 8 | 9 | A window that has a depth of 0 suggests that it does not support colours 10 | and is therefore not intended to be displayed. 11 | 12 | Mapping a window that has a depth of 0 will result in dwm crashing and 13 | this safeguard will avoid that. 14 | 15 | An example of this would be one of the hidden windows that the firefox 16 | browser manages. 17 | 18 | $ xdotool search firefox 19 | Defaulting to search window name, class, classname, and role 20 | 77594627 21 | 77594625 22 | 77594681 23 | 77594684 24 | 25 | Two of the windows listed above should have a depth of 0, this can be 26 | checked using xwininfo like this: 27 | 28 | $ xwininfo -id 77594625 29 | 30 | xwininfo: Window id: 0x4a00001 "Firefox" 31 | 32 | Absolute upper-left X: 10 33 | Absolute upper-left Y: 10 34 | Relative upper-left X: 10 35 | Relative upper-left Y: 10 36 | Width: 10 37 | Height: 10 38 | Depth: 0 39 | Visual: 0x506 40 | Visual Class: TrueColor 41 | Border width: 0 42 | Class: InputOnly 43 | Colormap: 0x0 (not installed) 44 | Bit Gravity State: ForgetGravity 45 | Window Gravity State: NorthWestGravity 46 | Backing Store State: NotUseful 47 | Save Under State: no 48 | Map State: IsUnMapped 49 | Override Redirect State: no 50 | Corners: +10+10 -6180+10 -6180-1900 +10-1900 51 | -geometry 10x10+10+10 52 | 53 | The window can then be explicitly mapped using xdotool. 54 | 55 | $ xdotool windowmap 77594625 56 | 57 | Without the safeguard dwm should crash following the above command. 58 | 59 | It should be noted that these kind of windows are not intended to 60 | be explicitly mapped like this and they won't be under normal 61 | circumstances. 62 | 63 | If you are trying to write a script that uses tools like mapw or 64 | xdotool to map and unmap windows then you may want to add some 65 | checks to avoid that you don't include windows that have a depth 66 | of 0. 67 | --- 68 | dwm.c | 2 ++ 69 | 1 file changed, 2 insertions(+) 70 | 71 | diff --git a/dwm.c b/dwm.c 72 | index 4465af1..0c064bd 100644 73 | --- a/dwm.c 74 | +++ b/dwm.c 75 | @@ -1094,6 +1094,8 @@ maprequest(XEvent *e) 76 | 77 | if (!XGetWindowAttributes(dpy, ev->window, &wa)) 78 | return; 79 | + if (!wa.depth) 80 | + return; 81 | if (wa.override_redirect) 82 | return; 83 | if (!wintoclient(ev->window)) 84 | -- 85 | 2.45.2 86 | 87 | -------------------------------------------------------------------------------- /dwm/dwm-zero_depth_safeguard-6.3.diff: -------------------------------------------------------------------------------- 1 | From 99fd1b7cb31ca14059fd202f3786aee19c6bc534 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:33:23 +0200 4 | Subject: [PATCH] Zero depth safeguard for dwm 5 | 6 | The colour depth attribute of an X window represents the number of bits 7 | that are used to represent the colour. 8 | 9 | A window that has a depth of 0 suggests that it does not support colours 10 | and is therefore not intended to be displayed. 11 | 12 | Mapping a window that has a depth of 0 will result in dwm crashing and 13 | this safeguard will avoid that. 14 | 15 | An example of this would be one of the hidden windows that the firefox 16 | browser manages. 17 | 18 | $ xdotool search firefox 19 | Defaulting to search window name, class, classname, and role 20 | 77594627 21 | 77594625 22 | 77594681 23 | 77594684 24 | 25 | Two of the windows listed above should have a depth of 0, this can be 26 | checked using xwininfo like this: 27 | 28 | $ xwininfo -id 77594625 29 | 30 | xwininfo: Window id: 0x4a00001 "Firefox" 31 | 32 | Absolute upper-left X: 10 33 | Absolute upper-left Y: 10 34 | Relative upper-left X: 10 35 | Relative upper-left Y: 10 36 | Width: 10 37 | Height: 10 38 | Depth: 0 39 | Visual: 0x506 40 | Visual Class: TrueColor 41 | Border width: 0 42 | Class: InputOnly 43 | Colormap: 0x0 (not installed) 44 | Bit Gravity State: ForgetGravity 45 | Window Gravity State: NorthWestGravity 46 | Backing Store State: NotUseful 47 | Save Under State: no 48 | Map State: IsUnMapped 49 | Override Redirect State: no 50 | Corners: +10+10 -6180+10 -6180-1900 +10-1900 51 | -geometry 10x10+10+10 52 | 53 | The window can then be explicitly mapped using xdotool. 54 | 55 | $ xdotool windowmap 77594625 56 | 57 | Without the safeguard dwm should crash following the above command. 58 | 59 | It should be noted that these kind of windows are not intended to 60 | be explicitly mapped like this and they won't be under normal 61 | circumstances. 62 | 63 | If you are trying to write a script that uses tools like mapw or 64 | xdotool to map and unmap windows then you may want to add some 65 | checks to avoid that you don't include windows that have a depth 66 | of 0. 67 | --- 68 | dwm.c | 2 ++ 69 | 1 file changed, 2 insertions(+) 70 | 71 | diff --git a/dwm.c b/dwm.c 72 | index a96f33c..807fcb9 100644 73 | --- a/dwm.c 74 | +++ b/dwm.c 75 | @@ -1098,6 +1098,8 @@ maprequest(XEvent *e) 76 | 77 | if (!XGetWindowAttributes(dpy, ev->window, &wa)) 78 | return; 79 | + if (!wa.depth) 80 | + return; 81 | if (wa.override_redirect) 82 | return; 83 | if (!wintoclient(ev->window)) 84 | -- 85 | 2.45.2 86 | 87 | -------------------------------------------------------------------------------- /dwm/dwm-zero_depth_safeguard-6.6.diff: -------------------------------------------------------------------------------- 1 | From 3e5808a6643013badede0f28d6b2eb61cafd35a0 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:33:23 +0200 4 | Subject: [PATCH] Zero depth safeguard for dwm 5 | 6 | The colour depth attribute of an X window represents the number of bits 7 | that are used to represent the colour. 8 | 9 | A window that has a depth of 0 suggests that it does not support colours 10 | and is therefore not intended to be displayed. 11 | 12 | Mapping a window that has a depth of 0 will result in dwm crashing and 13 | this safeguard will avoid that. 14 | 15 | An example of this would be one of the hidden windows that the firefox 16 | browser manages. 17 | 18 | $ xdotool search firefox 19 | Defaulting to search window name, class, classname, and role 20 | 77594627 21 | 77594625 22 | 77594681 23 | 77594684 24 | 25 | Two of the windows listed above should have a depth of 0, this can be 26 | checked using xwininfo like this: 27 | 28 | $ xwininfo -id 77594625 29 | 30 | xwininfo: Window id: 0x4a00001 "Firefox" 31 | 32 | Absolute upper-left X: 10 33 | Absolute upper-left Y: 10 34 | Relative upper-left X: 10 35 | Relative upper-left Y: 10 36 | Width: 10 37 | Height: 10 38 | Depth: 0 39 | Visual: 0x506 40 | Visual Class: TrueColor 41 | Border width: 0 42 | Class: InputOnly 43 | Colormap: 0x0 (not installed) 44 | Bit Gravity State: ForgetGravity 45 | Window Gravity State: NorthWestGravity 46 | Backing Store State: NotUseful 47 | Save Under State: no 48 | Map State: IsUnMapped 49 | Override Redirect State: no 50 | Corners: +10+10 -6180+10 -6180-1900 +10-1900 51 | -geometry 10x10+10+10 52 | 53 | The window can then be explicitly mapped using xdotool. 54 | 55 | $ xdotool windowmap 77594625 56 | 57 | Without the safeguard dwm should crash following the above command. 58 | 59 | It should be noted that these kind of windows are not intended to 60 | be explicitly mapped like this and they won't be under normal 61 | circumstances. 62 | 63 | If you are trying to write a script that uses tools like mapw or 64 | xdotool to map and unmap windows then you may want to add some 65 | checks to avoid that you don't include windows that have a depth 66 | of 0. 67 | --- 68 | dwm.c | 2 ++ 69 | 1 file changed, 2 insertions(+) 70 | 71 | diff --git a/dwm.c b/dwm.c 72 | index 1443802..2799232 100644 73 | --- a/dwm.c 74 | +++ b/dwm.c 75 | @@ -1105,6 +1105,8 @@ maprequest(XEvent *e) 76 | 77 | if (!XGetWindowAttributes(dpy, ev->window, &wa) || wa.override_redirect) 78 | return; 79 | + if (!wa.depth) 80 | + return; 81 | if (!wintoclient(ev->window)) 82 | manage(ev->window, &wa); 83 | } 84 | -- 85 | 2.50.1 86 | 87 | -------------------------------------------------------------------------------- /dwm/dwm-centeredsizehints-6.2.diff: -------------------------------------------------------------------------------- 1 | From 48b99ccded0f23bd115cecb8e1fe34fcdb51eaf5 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 24 Jun 2024 16:03:02 +0200 4 | Subject: [PATCH] Center clients within their allocated tile based on size 5 | hints 6 | 7 | --- 8 | dwm.c | 30 ++++++++++++++++++++++++++---- 9 | 1 file changed, 26 insertions(+), 4 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index 4465af1..499ae91 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -190,6 +190,7 @@ static void quit(const Arg *arg); 16 | static Monitor *recttomon(int x, int y, int w, int h); 17 | static void resize(Client *c, int x, int y, int w, int h, int interact); 18 | static void resizeclient(Client *c, int x, int y, int w, int h); 19 | +static void resizeclientpad(Client *c, int x, int y, int w, int h, int xpad, int ypad); 20 | static void resizemouse(const Arg *arg); 21 | static void restack(Monitor *m); 22 | static void run(void); 23 | @@ -1229,6 +1230,7 @@ propertynotify(XEvent *e) 24 | break; 25 | case XA_WM_NORMAL_HINTS: 26 | updatesizehints(c); 27 | + arrangemon(c->mon); 28 | break; 29 | case XA_WM_HINTS: 30 | updatewmhints(c); 31 | @@ -1266,21 +1268,41 @@ recttomon(int x, int y, int w, int h) 32 | } 33 | 34 | void 35 | -resize(Client *c, int x, int y, int w, int h, int interact) 36 | +resize(Client *c, int tx, int ty, int tw, int th, int interact) 37 | { 38 | - if (applysizehints(c, &x, &y, &w, &h, interact)) 39 | - resizeclient(c, x, y, w, h); 40 | + int wh = tw, hh = th; 41 | + if (applysizehints(c, &tx, &ty, &wh, &hh, interact)) 42 | + resizeclientpad(c, tx, ty, wh, hh, tw, th); 43 | } 44 | 45 | +/* This wrapper is just for compatibility with other patches that may call resizeclient */ 46 | void 47 | resizeclient(Client *c, int x, int y, int w, int h) 48 | { 49 | - XWindowChanges wc; 50 | + resizeclientpad(c, x, y, w, h, w, h); 51 | +} 52 | 53 | +/* This is essentially the resizeclient function renamed with two 54 | + * additional parameters, tw and th (for tile width and height). */ 55 | +void 56 | +resizeclientpad(Client *c, int x, int y, int w, int h, int tw, int th) 57 | +{ 58 | + XWindowChanges wc; 59 | c->oldx = c->x; c->x = wc.x = x; 60 | c->oldy = c->y; c->y = wc.y = y; 61 | c->oldw = c->w; c->w = wc.width = w; 62 | c->oldh = c->h; c->h = wc.height = h; 63 | + if (!c->isfloating) { 64 | + if (w != tw) { 65 | + wc.x += (tw - w) / 2; 66 | + c->w = tw; 67 | + } 68 | + if (h != th) { 69 | + wc.y += (th - h) / 2; 70 | + c->h = th; 71 | + } 72 | + } 73 | + 74 | wc.border_width = c->bw; 75 | XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); 76 | configure(c); 77 | -- 78 | 2.45.2 79 | 80 | -------------------------------------------------------------------------------- /dwm/dwm-centeredsizehints-6.3.diff: -------------------------------------------------------------------------------- 1 | From 08628b009cf2dce509b2d4b3954661fdc3f0e741 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 24 Jun 2024 16:03:31 +0200 4 | Subject: [PATCH] Center clients within their allocated tile based on size 5 | hints 6 | 7 | --- 8 | dwm.c | 30 ++++++++++++++++++++++++++---- 9 | 1 file changed, 26 insertions(+), 4 deletions(-) 10 | 11 | diff --git a/dwm.c b/dwm.c 12 | index a96f33c..bc7c7ef 100644 13 | --- a/dwm.c 14 | +++ b/dwm.c 15 | @@ -191,6 +191,7 @@ static void quit(const Arg *arg); 16 | static Monitor *recttomon(int x, int y, int w, int h); 17 | static void resize(Client *c, int x, int y, int w, int h, int interact); 18 | static void resizeclient(Client *c, int x, int y, int w, int h); 19 | +static void resizeclientpad(Client *c, int x, int y, int w, int h, int xpad, int ypad); 20 | static void resizemouse(const Arg *arg); 21 | static void restack(Monitor *m); 22 | static void run(void); 23 | @@ -1233,6 +1234,7 @@ propertynotify(XEvent *e) 24 | break; 25 | case XA_WM_NORMAL_HINTS: 26 | updatesizehints(c); 27 | + arrangemon(c->mon); 28 | break; 29 | case XA_WM_HINTS: 30 | updatewmhints(c); 31 | @@ -1270,21 +1272,41 @@ recttomon(int x, int y, int w, int h) 32 | } 33 | 34 | void 35 | -resize(Client *c, int x, int y, int w, int h, int interact) 36 | +resize(Client *c, int tx, int ty, int tw, int th, int interact) 37 | { 38 | - if (applysizehints(c, &x, &y, &w, &h, interact)) 39 | - resizeclient(c, x, y, w, h); 40 | + int wh = tw, hh = th; 41 | + if (applysizehints(c, &tx, &ty, &wh, &hh, interact)) 42 | + resizeclientpad(c, tx, ty, wh, hh, tw, th); 43 | } 44 | 45 | +/* This wrapper is just for compatibility with other patches that may call resizeclient */ 46 | void 47 | resizeclient(Client *c, int x, int y, int w, int h) 48 | { 49 | - XWindowChanges wc; 50 | + resizeclientpad(c, x, y, w, h, w, h); 51 | +} 52 | 53 | +/* This is essentially the resizeclient function renamed with two 54 | + * additional parameters, tw and th (for tile width and height). */ 55 | +void 56 | +resizeclientpad(Client *c, int x, int y, int w, int h, int tw, int th) 57 | +{ 58 | + XWindowChanges wc; 59 | c->oldx = c->x; c->x = wc.x = x; 60 | c->oldy = c->y; c->y = wc.y = y; 61 | c->oldw = c->w; c->w = wc.width = w; 62 | c->oldh = c->h; c->h = wc.height = h; 63 | + if (!c->isfloating) { 64 | + if (w != tw) { 65 | + wc.x += (tw - w) / 2; 66 | + c->w = tw; 67 | + } 68 | + if (h != th) { 69 | + wc.y += (th - h) / 2; 70 | + c->h = th; 71 | + } 72 | + } 73 | + 74 | wc.border_width = c->bw; 75 | XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); 76 | configure(c); 77 | -- 78 | 2.45.2 79 | 80 | -------------------------------------------------------------------------------- /dwm/dwm-sortscreens-6.5.diff: -------------------------------------------------------------------------------- 1 | From 0b0b97823147e04f21cd6039f2596b933f59842a Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Thu, 27 Jun 2024 08:36:51 +0200 4 | Subject: [PATCH] Sort screens by origin 5 | 6 | Doing a multi-head setup using other means than Xinerama may lead to 7 | XineramaQueryScreens() returning the screens in an order that does not 8 | actually represent the actual screen layout. This in turn may result 9 | in dwm using the "wrong" monitor in monitor related 10 | functions (focusmon(), tagmon(), applying rules, ...). 11 | 12 | This change sorts the list of unique screens by their origin to 13 | alleviate this problem. 14 | --- 15 | dwm.c | 24 ++++++++++++++++++++++++ 16 | 1 file changed, 24 insertions(+) 17 | 18 | diff --git a/dwm.c b/dwm.c 19 | index f1d86b2..6a57be9 100644 20 | --- a/dwm.c 21 | +++ b/dwm.c 22 | @@ -56,6 +56,8 @@ 23 | #define HEIGHT(X) ((X)->h + 2 * (X)->bw) 24 | #define TAGMASK ((1 << LENGTH(tags)) - 1) 25 | #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) 26 | +#define RIGHTOF(a,b) (a.y_org > b.y_org) || \ 27 | + ((a.y_org == b.y_org) && (a.x_org > b.x_org)) 28 | 29 | /* enums */ 30 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 31 | @@ -205,6 +207,9 @@ static void setmfact(const Arg *arg); 32 | static void setup(void); 33 | static void seturgent(Client *c, int urg); 34 | static void showhide(Client *c); 35 | +#ifdef XINERAMA 36 | +static void sortscreens(XineramaScreenInfo *screens, int n); 37 | +#endif /* XINERAMA */ 38 | static void spawn(const Arg *arg); 39 | static void tag(const Arg *arg); 40 | static void tagmon(const Arg *arg); 41 | @@ -1644,6 +1649,24 @@ showhide(Client *c) 42 | } 43 | } 44 | 45 | +#ifdef XINERAMA 46 | +void 47 | +sortscreens(XineramaScreenInfo *screens, int n) 48 | +{ 49 | + int i, j; 50 | + XineramaScreenInfo *screen = ecalloc(1, sizeof(XineramaScreenInfo)); 51 | + 52 | + for (i = 0; i < n; i++) 53 | + for (j = i + 1; j < n; j++) 54 | + if (RIGHTOF(screens[i], screens[j])) { 55 | + memcpy(&screen[0], &screens[i], sizeof(XineramaScreenInfo)); 56 | + memcpy(&screens[i], &screens[j], sizeof(XineramaScreenInfo)); 57 | + memcpy(&screens[j], &screen[0], sizeof(XineramaScreenInfo)); 58 | + } 59 | + XFree(screen); 60 | +} 61 | +#endif /* XINERAMA */ 62 | + 63 | void 64 | spawn(const Arg *arg) 65 | { 66 | @@ -1885,6 +1908,7 @@ updategeom(void) 67 | memcpy(&unique[j++], &info[i], sizeof(XineramaScreenInfo)); 68 | XFree(info); 69 | nn = j; 70 | + sortscreens(unique, nn); 71 | 72 | /* new monitors if nn > n */ 73 | for (i = n; i < nn; i++) { 74 | -- 75 | 2.45.2 76 | 77 | -------------------------------------------------------------------------------- /dwm/dwm-sortscreens-6.6.diff: -------------------------------------------------------------------------------- 1 | From 2d2a2563a52096b6356241b6b7009ff9042c67cd Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Thu, 27 Jun 2024 08:36:51 +0200 4 | Subject: [PATCH] Sort screens by origin 5 | 6 | Doing a multi-head setup using other means than Xinerama may lead to 7 | XineramaQueryScreens() returning the screens in an order that does not 8 | actually represent the actual screen layout. This in turn may result 9 | in dwm using the "wrong" monitor in monitor related 10 | functions (focusmon(), tagmon(), applying rules, ...). 11 | 12 | This change sorts the list of unique screens by their origin to 13 | alleviate this problem. 14 | --- 15 | dwm.c | 24 ++++++++++++++++++++++++ 16 | 1 file changed, 24 insertions(+) 17 | 18 | diff --git a/dwm.c b/dwm.c 19 | index 1443802..7997d0d 100644 20 | --- a/dwm.c 21 | +++ b/dwm.c 22 | @@ -55,6 +55,8 @@ 23 | #define HEIGHT(X) ((X)->h + 2 * (X)->bw) 24 | #define TAGMASK ((1 << LENGTH(tags)) - 1) 25 | #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) 26 | +#define RIGHTOF(a,b) (a.y_org > b.y_org) || \ 27 | + ((a.y_org == b.y_org) && (a.x_org > b.x_org)) 28 | 29 | /* enums */ 30 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 31 | @@ -204,6 +206,9 @@ static void setmfact(const Arg *arg); 32 | static void setup(void); 33 | static void seturgent(Client *c, int urg); 34 | static void showhide(Client *c); 35 | +#ifdef XINERAMA 36 | +static void sortscreens(XineramaScreenInfo *screens, int n); 37 | +#endif /* XINERAMA */ 38 | static void spawn(const Arg *arg); 39 | static void tag(const Arg *arg); 40 | static void tagmon(const Arg *arg); 41 | @@ -1643,6 +1648,24 @@ showhide(Client *c) 42 | } 43 | } 44 | 45 | +#ifdef XINERAMA 46 | +void 47 | +sortscreens(XineramaScreenInfo *screens, int n) 48 | +{ 49 | + int i, j; 50 | + XineramaScreenInfo *screen = ecalloc(1, sizeof(XineramaScreenInfo)); 51 | + 52 | + for (i = 0; i < n; i++) 53 | + for (j = i + 1; j < n; j++) 54 | + if (RIGHTOF(screens[i], screens[j])) { 55 | + memcpy(&screen[0], &screens[i], sizeof(XineramaScreenInfo)); 56 | + memcpy(&screens[i], &screens[j], sizeof(XineramaScreenInfo)); 57 | + memcpy(&screens[j], &screen[0], sizeof(XineramaScreenInfo)); 58 | + } 59 | + XFree(screen); 60 | +} 61 | +#endif /* XINERAMA */ 62 | + 63 | void 64 | spawn(const Arg *arg) 65 | { 66 | @@ -1884,6 +1907,7 @@ updategeom(void) 67 | memcpy(&unique[j++], &info[i], sizeof(XineramaScreenInfo)); 68 | XFree(info); 69 | nn = j; 70 | + sortscreens(unique, nn); 71 | 72 | /* new monitors if nn > n */ 73 | for (i = n; i < nn; i++) { 74 | -- 75 | 2.50.1 76 | 77 | -------------------------------------------------------------------------------- /dwm/dwm-tagallmon-6.2.diff: -------------------------------------------------------------------------------- 1 | From cfc01750812cff73748e95b24d180a61556e893e Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:58:18 +0200 4 | Subject: [PATCH] tagallmon 5 | 6 | Move all visible windows to an adjacent monitor. 7 | --- 8 | config.def.h | 2 ++ 9 | dwm.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 10 | 2 files changed, 45 insertions(+) 11 | 12 | diff --git a/config.def.h b/config.def.h 13 | index 1c0b587..4852ae2 100644 14 | --- a/config.def.h 15 | +++ b/config.def.h 16 | @@ -84,6 +84,8 @@ static Key keys[] = { 17 | { MODKEY, XK_period, focusmon, {.i = +1 } }, 18 | { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 19 | { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 20 | + { MODKEY|Mod4Mask|ShiftMask, XK_comma, tagallmon, {.i = +1 } }, 21 | + { MODKEY|Mod4Mask|ShiftMask, XK_period, tagallmon, {.i = -1 } }, 22 | TAGKEYS( XK_1, 0) 23 | TAGKEYS( XK_2, 1) 24 | TAGKEYS( XK_3, 2) 25 | diff --git a/dwm.c b/dwm.c 26 | index 4465af1..9fd5b03 100644 27 | --- a/dwm.c 28 | +++ b/dwm.c 29 | @@ -208,6 +208,7 @@ static void sigchld(int unused); 30 | static void spawn(const Arg *arg); 31 | static void tag(const Arg *arg); 32 | static void tagmon(const Arg *arg); 33 | +static void tagallmon(const Arg *arg); 34 | static void tile(Monitor *); 35 | static void togglebar(const Arg *arg); 36 | static void togglefloating(const Arg *arg); 37 | @@ -1670,6 +1671,48 @@ tagmon(const Arg *arg) 38 | sendmon(selmon->sel, dirtomon(arg->i)); 39 | } 40 | 41 | +void 42 | +tagallmon(const Arg *arg) 43 | +{ 44 | + Monitor *m; 45 | + Client *c, *last, *slast, *next; 46 | + 47 | + if (!mons->next) 48 | + return; 49 | + 50 | + m = dirtomon(arg->i); 51 | + for (last = m->clients; last && last->next; last = last->next); 52 | + for (slast = m->stack; slast && slast->snext; slast = slast->snext); 53 | + 54 | + for (c = selmon->clients; c; c = next) { 55 | + next = c->next; 56 | + if (!ISVISIBLE(c)) 57 | + continue; 58 | + unfocus(c, 1); 59 | + detach(c); 60 | + detachstack(c); 61 | + c->mon = m; 62 | + c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 63 | + c->next = NULL; 64 | + c->snext = NULL; 65 | + if (last) 66 | + last = last->next = c; 67 | + else 68 | + m->clients = last = c; 69 | + if (slast) 70 | + slast = slast->snext = c; 71 | + else 72 | + m->stack = slast = c; 73 | + if (c->isfullscreen) { 74 | + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); 75 | + XRaiseWindow(dpy, c->win); 76 | + } 77 | + } 78 | + 79 | + focus(NULL); 80 | + arrange(NULL); 81 | +} 82 | + 83 | void 84 | tile(Monitor *m) 85 | { 86 | -- 87 | 2.45.2 88 | 89 | -------------------------------------------------------------------------------- /dwm/dwm-tagallmon-6.3.diff: -------------------------------------------------------------------------------- 1 | From e88db8b1dfe099fda78895c8d5ff6abd5d23f28c Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:58:33 +0200 4 | Subject: [PATCH] tagallmon 5 | 6 | Move all visible windows to an adjacent monitor. 7 | --- 8 | config.def.h | 2 ++ 9 | dwm.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 10 | 2 files changed, 45 insertions(+) 11 | 12 | diff --git a/config.def.h b/config.def.h 13 | index a2ac963..0061425 100644 14 | --- a/config.def.h 15 | +++ b/config.def.h 16 | @@ -85,6 +85,8 @@ static Key keys[] = { 17 | { MODKEY, XK_period, focusmon, {.i = +1 } }, 18 | { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 19 | { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 20 | + { MODKEY|Mod4Mask|ShiftMask, XK_comma, tagallmon, {.i = +1 } }, 21 | + { MODKEY|Mod4Mask|ShiftMask, XK_period, tagallmon, {.i = -1 } }, 22 | TAGKEYS( XK_1, 0) 23 | TAGKEYS( XK_2, 1) 24 | TAGKEYS( XK_3, 2) 25 | diff --git a/dwm.c b/dwm.c 26 | index a96f33c..75dae54 100644 27 | --- a/dwm.c 28 | +++ b/dwm.c 29 | @@ -209,6 +209,7 @@ static void sigchld(int unused); 30 | static void spawn(const Arg *arg); 31 | static void tag(const Arg *arg); 32 | static void tagmon(const Arg *arg); 33 | +static void tagallmon(const Arg *arg); 34 | static void tile(Monitor *); 35 | static void togglebar(const Arg *arg); 36 | static void togglefloating(const Arg *arg); 37 | @@ -1674,6 +1675,48 @@ tagmon(const Arg *arg) 38 | sendmon(selmon->sel, dirtomon(arg->i)); 39 | } 40 | 41 | +void 42 | +tagallmon(const Arg *arg) 43 | +{ 44 | + Monitor *m; 45 | + Client *c, *last, *slast, *next; 46 | + 47 | + if (!mons->next) 48 | + return; 49 | + 50 | + m = dirtomon(arg->i); 51 | + for (last = m->clients; last && last->next; last = last->next); 52 | + for (slast = m->stack; slast && slast->snext; slast = slast->snext); 53 | + 54 | + for (c = selmon->clients; c; c = next) { 55 | + next = c->next; 56 | + if (!ISVISIBLE(c)) 57 | + continue; 58 | + unfocus(c, 1); 59 | + detach(c); 60 | + detachstack(c); 61 | + c->mon = m; 62 | + c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 63 | + c->next = NULL; 64 | + c->snext = NULL; 65 | + if (last) 66 | + last = last->next = c; 67 | + else 68 | + m->clients = last = c; 69 | + if (slast) 70 | + slast = slast->snext = c; 71 | + else 72 | + m->stack = slast = c; 73 | + if (c->isfullscreen) { 74 | + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); 75 | + XRaiseWindow(dpy, c->win); 76 | + } 77 | + } 78 | + 79 | + focus(NULL); 80 | + arrange(NULL); 81 | +} 82 | + 83 | void 84 | tile(Monitor *m) 85 | { 86 | -- 87 | 2.45.2 88 | 89 | -------------------------------------------------------------------------------- /dwm/dwm-tagallmon-6.5.diff: -------------------------------------------------------------------------------- 1 | From 9a794b105ca65664b497c3fa555465ed300a17f9 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:58:33 +0200 4 | Subject: [PATCH] tagallmon 5 | 6 | Move all visible windows to an adjacent monitor. 7 | --- 8 | config.def.h | 2 ++ 9 | dwm.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 10 | 2 files changed, 45 insertions(+) 11 | 12 | diff --git a/config.def.h b/config.def.h 13 | index 9efa774..a5e5897 100644 14 | --- a/config.def.h 15 | +++ b/config.def.h 16 | @@ -85,6 +85,8 @@ static const Key keys[] = { 17 | { MODKEY, XK_period, focusmon, {.i = +1 } }, 18 | { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 19 | { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 20 | + { MODKEY|Mod4Mask|ShiftMask, XK_comma, tagallmon, {.i = +1 } }, 21 | + { MODKEY|Mod4Mask|ShiftMask, XK_period, tagallmon, {.i = -1 } }, 22 | TAGKEYS( XK_1, 0) 23 | TAGKEYS( XK_2, 1) 24 | TAGKEYS( XK_3, 2) 25 | diff --git a/dwm.c b/dwm.c 26 | index f1d86b2..d3e93f3 100644 27 | --- a/dwm.c 28 | +++ b/dwm.c 29 | @@ -208,6 +208,7 @@ static void showhide(Client *c); 30 | static void spawn(const Arg *arg); 31 | static void tag(const Arg *arg); 32 | static void tagmon(const Arg *arg); 33 | +static void tagallmon(const Arg *arg); 34 | static void tile(Monitor *m); 35 | static void togglebar(const Arg *arg); 36 | static void togglefloating(const Arg *arg); 37 | @@ -1684,6 +1685,48 @@ tagmon(const Arg *arg) 38 | sendmon(selmon->sel, dirtomon(arg->i)); 39 | } 40 | 41 | +void 42 | +tagallmon(const Arg *arg) 43 | +{ 44 | + Monitor *m; 45 | + Client *c, *last, *slast, *next; 46 | + 47 | + if (!mons->next) 48 | + return; 49 | + 50 | + m = dirtomon(arg->i); 51 | + for (last = m->clients; last && last->next; last = last->next); 52 | + for (slast = m->stack; slast && slast->snext; slast = slast->snext); 53 | + 54 | + for (c = selmon->clients; c; c = next) { 55 | + next = c->next; 56 | + if (!ISVISIBLE(c)) 57 | + continue; 58 | + unfocus(c, 1); 59 | + detach(c); 60 | + detachstack(c); 61 | + c->mon = m; 62 | + c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 63 | + c->next = NULL; 64 | + c->snext = NULL; 65 | + if (last) 66 | + last = last->next = c; 67 | + else 68 | + m->clients = last = c; 69 | + if (slast) 70 | + slast = slast->snext = c; 71 | + else 72 | + m->stack = slast = c; 73 | + if (c->isfullscreen) { 74 | + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); 75 | + XRaiseWindow(dpy, c->win); 76 | + } 77 | + } 78 | + 79 | + focus(NULL); 80 | + arrange(NULL); 81 | +} 82 | + 83 | void 84 | tile(Monitor *m) 85 | { 86 | -- 87 | 2.45.2 88 | 89 | -------------------------------------------------------------------------------- /dwm/dwm-tagallmon-6.6.diff: -------------------------------------------------------------------------------- 1 | From 3dc297b37e7141517b1c37f232b14c32e1ea787e Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Wed, 26 Jun 2024 22:58:33 +0200 4 | Subject: [PATCH] tagallmon 5 | 6 | Move all visible windows to an adjacent monitor. 7 | --- 8 | config.def.h | 2 ++ 9 | dwm.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 10 | 2 files changed, 45 insertions(+) 11 | 12 | diff --git a/config.def.h b/config.def.h 13 | index 9efa774..a5e5897 100644 14 | --- a/config.def.h 15 | +++ b/config.def.h 16 | @@ -85,6 +85,8 @@ static const Key keys[] = { 17 | { MODKEY, XK_period, focusmon, {.i = +1 } }, 18 | { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 19 | { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 20 | + { MODKEY|Mod4Mask|ShiftMask, XK_comma, tagallmon, {.i = +1 } }, 21 | + { MODKEY|Mod4Mask|ShiftMask, XK_period, tagallmon, {.i = -1 } }, 22 | TAGKEYS( XK_1, 0) 23 | TAGKEYS( XK_2, 1) 24 | TAGKEYS( XK_3, 2) 25 | diff --git a/dwm.c b/dwm.c 26 | index 1443802..759201f 100644 27 | --- a/dwm.c 28 | +++ b/dwm.c 29 | @@ -207,6 +207,7 @@ static void showhide(Client *c); 30 | static void spawn(const Arg *arg); 31 | static void tag(const Arg *arg); 32 | static void tagmon(const Arg *arg); 33 | +static void tagallmon(const Arg *arg); 34 | static void tile(Monitor *m); 35 | static void togglebar(const Arg *arg); 36 | static void togglefloating(const Arg *arg); 37 | @@ -1683,6 +1684,48 @@ tagmon(const Arg *arg) 38 | sendmon(selmon->sel, dirtomon(arg->i)); 39 | } 40 | 41 | +void 42 | +tagallmon(const Arg *arg) 43 | +{ 44 | + Monitor *m; 45 | + Client *c, *last, *slast, *next; 46 | + 47 | + if (!mons->next) 48 | + return; 49 | + 50 | + m = dirtomon(arg->i); 51 | + for (last = m->clients; last && last->next; last = last->next); 52 | + for (slast = m->stack; slast && slast->snext; slast = slast->snext); 53 | + 54 | + for (c = selmon->clients; c; c = next) { 55 | + next = c->next; 56 | + if (!ISVISIBLE(c)) 57 | + continue; 58 | + unfocus(c, 1); 59 | + detach(c); 60 | + detachstack(c); 61 | + c->mon = m; 62 | + c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 63 | + c->next = NULL; 64 | + c->snext = NULL; 65 | + if (last) 66 | + last = last->next = c; 67 | + else 68 | + m->clients = last = c; 69 | + if (slast) 70 | + slast = slast->snext = c; 71 | + else 72 | + m->stack = slast = c; 73 | + if (c->isfullscreen) { 74 | + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); 75 | + XRaiseWindow(dpy, c->win); 76 | + } 77 | + } 78 | + 79 | + focus(NULL); 80 | + arrange(NULL); 81 | +} 82 | + 83 | void 84 | tile(Monitor *m) 85 | { 86 | -- 87 | 2.50.1 88 | 89 | -------------------------------------------------------------------------------- /dwm/dwm-fullscreen-compilation-tagallmon-6.2.diff: -------------------------------------------------------------------------------- 1 | From a4e39543d6f9796d073404f63b231b82bd77de3c Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:17:28 +0200 4 | Subject: [PATCH 2/2] Adding fullscreen-compilation compatible tagallmon patch 5 | 6 | --- 7 | config.def.h | 2 ++ 8 | dwm.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 9 | 2 files changed, 47 insertions(+) 10 | 11 | diff --git a/config.def.h b/config.def.h 12 | index 5f28f2c..0d5456a 100644 13 | --- a/config.def.h 14 | +++ b/config.def.h 15 | @@ -86,6 +86,8 @@ static Key keys[] = { 16 | { MODKEY, XK_period, focusmon, {.i = +1 } }, 17 | { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 18 | { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 19 | + { MODKEY|Mod4Mask|ShiftMask, XK_comma, tagallmon, {.i = +1 } }, 20 | + { MODKEY|Mod4Mask|ShiftMask, XK_period, tagallmon, {.i = -1 } }, 21 | TAGKEYS( XK_1, 0) 22 | TAGKEYS( XK_2, 1) 23 | TAGKEYS( XK_3, 2) 24 | diff --git a/dwm.c b/dwm.c 25 | index 763c224..663a996 100644 26 | --- a/dwm.c 27 | +++ b/dwm.c 28 | @@ -209,6 +209,7 @@ static void showhide(Client *c); 29 | static void sigchld(int unused); 30 | static void spawn(const Arg *arg); 31 | static void tag(const Arg *arg); 32 | +static void tagallmon(const Arg *arg); 33 | static void tagmon(const Arg *arg); 34 | static void tile(Monitor *); 35 | static void togglebar(const Arg *arg); 36 | @@ -1739,6 +1740,50 @@ tag(const Arg *arg) 37 | } 38 | } 39 | 40 | +void 41 | +tagallmon(const Arg *arg) 42 | +{ 43 | + Monitor *m; 44 | + Client *c, *last, *slast, *next; 45 | + 46 | + if (!mons->next) 47 | + return; 48 | + 49 | + m = dirtomon(arg->i); 50 | + for (last = m->clients; last && last->next; last = last->next); 51 | + for (slast = m->stack; slast && slast->snext; slast = slast->snext); 52 | + 53 | + for (c = selmon->clients; c; c = next) { 54 | + next = c->next; 55 | + if (!ISVISIBLE(c)) 56 | + continue; 57 | + unfocus(c, 1, NULL); 58 | + detach(c); 59 | + detachstack(c); 60 | + c->mon = m; 61 | + c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 62 | + c->next = NULL; 63 | + c->snext = NULL; 64 | + if (last) 65 | + last = last->next = c; 66 | + else 67 | + m->clients = last = c; 68 | + if (slast) 69 | + slast = slast->snext = c; 70 | + else 71 | + m->stack = slast = c; 72 | + if (c->isfullscreen) { 73 | + if (c->fakefullscreen != 1) { 74 | + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); 75 | + XRaiseWindow(dpy, c->win); 76 | + } 77 | + } 78 | + } 79 | + 80 | + focus(NULL); 81 | + arrange(NULL); 82 | +} 83 | + 84 | void 85 | tagmon(const Arg *arg) 86 | { 87 | -- 88 | 2.45.2 89 | 90 | -------------------------------------------------------------------------------- /dwm/dwm-fullscreen-compilation-tagallmon-6.3.diff: -------------------------------------------------------------------------------- 1 | From f9d00f84b88aa33e1f898a2d62d9883d313035ad Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:17:46 +0200 4 | Subject: [PATCH 2/2] Adding fullscreen-compilation compatible tagallmon patch 5 | 6 | --- 7 | config.def.h | 2 ++ 8 | dwm.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 9 | 2 files changed, 47 insertions(+) 10 | 11 | diff --git a/config.def.h b/config.def.h 12 | index 5f28f2c..0d5456a 100644 13 | --- a/config.def.h 14 | +++ b/config.def.h 15 | @@ -86,6 +86,8 @@ static Key keys[] = { 16 | { MODKEY, XK_period, focusmon, {.i = +1 } }, 17 | { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 18 | { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 19 | + { MODKEY|Mod4Mask|ShiftMask, XK_comma, tagallmon, {.i = +1 } }, 20 | + { MODKEY|Mod4Mask|ShiftMask, XK_period, tagallmon, {.i = -1 } }, 21 | TAGKEYS( XK_1, 0) 22 | TAGKEYS( XK_2, 1) 23 | TAGKEYS( XK_3, 2) 24 | diff --git a/dwm.c b/dwm.c 25 | index 53f0bd4..e37f530 100644 26 | --- a/dwm.c 27 | +++ b/dwm.c 28 | @@ -210,6 +210,7 @@ static void showhide(Client *c); 29 | static void sigchld(int unused); 30 | static void spawn(const Arg *arg); 31 | static void tag(const Arg *arg); 32 | +static void tagallmon(const Arg *arg); 33 | static void tagmon(const Arg *arg); 34 | static void tile(Monitor *); 35 | static void togglebar(const Arg *arg); 36 | @@ -1737,6 +1738,50 @@ tag(const Arg *arg) 37 | } 38 | } 39 | 40 | +void 41 | +tagallmon(const Arg *arg) 42 | +{ 43 | + Monitor *m; 44 | + Client *c, *last, *slast, *next; 45 | + 46 | + if (!mons->next) 47 | + return; 48 | + 49 | + m = dirtomon(arg->i); 50 | + for (last = m->clients; last && last->next; last = last->next); 51 | + for (slast = m->stack; slast && slast->snext; slast = slast->snext); 52 | + 53 | + for (c = selmon->clients; c; c = next) { 54 | + next = c->next; 55 | + if (!ISVISIBLE(c)) 56 | + continue; 57 | + unfocus(c, 1, NULL); 58 | + detach(c); 59 | + detachstack(c); 60 | + c->mon = m; 61 | + c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 62 | + c->next = NULL; 63 | + c->snext = NULL; 64 | + if (last) 65 | + last = last->next = c; 66 | + else 67 | + m->clients = last = c; 68 | + if (slast) 69 | + slast = slast->snext = c; 70 | + else 71 | + m->stack = slast = c; 72 | + if (c->isfullscreen) { 73 | + if (c->fakefullscreen != 1) { 74 | + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); 75 | + XRaiseWindow(dpy, c->win); 76 | + } 77 | + } 78 | + } 79 | + 80 | + focus(NULL); 81 | + arrange(NULL); 82 | +} 83 | + 84 | void 85 | tagmon(const Arg *arg) 86 | { 87 | -- 88 | 2.45.2 89 | 90 | -------------------------------------------------------------------------------- /dwm/dwm-sortscreens-20191007-cb3f58a.diff: -------------------------------------------------------------------------------- 1 | From fe6553c3d6e7e93aa74242cda0c33e05571147aa Mon Sep 17 00:00:00 2001 2 | From: Sebastian Sareyko 3 | Date: Fri, 27 Sep 2019 12:32:41 +0200 4 | Subject: [PATCH] Sort screens by origin 5 | 6 | Doing a multi-head setup using other means than Xinerama may lead to 7 | XineramaQueryScreens() returning the screens in an order that does not 8 | actually represent the actual screen layout. This in turn may result 9 | in dwm using the "wrong" monitor in monitor related 10 | functions (focusmon(), tagmon(), applying rules, ...). 11 | 12 | This change sorts the list of unique screens by their origin to 13 | alleviate this problem. 14 | --- 15 | dwm.c | 24 ++++++++++++++++++++++++ 16 | 1 file changed, 24 insertions(+) 17 | 18 | diff --git a/dwm.c b/dwm.c 19 | index 4465af1..3a60b0c 100644 20 | --- a/dwm.c 21 | +++ b/dwm.c 22 | @@ -56,6 +56,8 @@ 23 | #define HEIGHT(X) ((X)->h + 2 * (X)->bw) 24 | #define TAGMASK ((1 << LENGTH(tags)) - 1) 25 | #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) 26 | +#define RIGHTOF(a,b) (a.y_org > b.y_org) || \ 27 | + ((a.y_org == b.y_org) && (a.x_org > b.x_org)) 28 | 29 | /* enums */ 30 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 31 | @@ -205,6 +207,9 @@ static void setup(void); 32 | static void seturgent(Client *c, int urg); 33 | static void showhide(Client *c); 34 | static void sigchld(int unused); 35 | +#ifdef XINERAMA 36 | +static void sortscreens(XineramaScreenInfo *screens, int n); 37 | +#endif /* XINERAMA */ 38 | static void spawn(const Arg *arg); 39 | static void tag(const Arg *arg); 40 | static void tagmon(const Arg *arg); 41 | @@ -1636,6 +1641,24 @@ sigchld(int unused) 42 | while (0 < waitpid(-1, NULL, WNOHANG)); 43 | } 44 | 45 | +#ifdef XINERAMA 46 | +void 47 | +sortscreens(XineramaScreenInfo *screens, int n) 48 | +{ 49 | + int i, j; 50 | + XineramaScreenInfo *screen = ecalloc(1, sizeof(XineramaScreenInfo)); 51 | + 52 | + for (i = 0; i < n; i++) 53 | + for (j = i + 1; j < n; j++) 54 | + if (RIGHTOF(screens[i], screens[j])) { 55 | + memcpy(&screen[0], &screens[i], sizeof(XineramaScreenInfo)); 56 | + memcpy(&screens[i], &screens[j], sizeof(XineramaScreenInfo)); 57 | + memcpy(&screens[j], &screen[0], sizeof(XineramaScreenInfo)); 58 | + } 59 | + XFree(screen); 60 | +} 61 | +#endif /* XINERAMA */ 62 | + 63 | void 64 | spawn(const Arg *arg) 65 | { 66 | @@ -1868,6 +1891,7 @@ updategeom(void) 67 | memcpy(&unique[j++], &info[i], sizeof(XineramaScreenInfo)); 68 | XFree(info); 69 | nn = j; 70 | + sortscreens(unique, nn); 71 | if (n <= nn) { /* new monitors available */ 72 | for (i = 0; i < (nn - n); i++) { 73 | for (m = mons; m && m->next; m = m->next); 74 | -- 75 | 2.21.0 76 | 77 | -------------------------------------------------------------------------------- /dwm/dwm-lock_masks-6.4.diff: -------------------------------------------------------------------------------- 1 | From 03c639a6d2432afbdb63998b2f1ea08a7d0ffc0c Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:26:29 +0200 4 | Subject: [PATCH] lockmask patch 5 | 6 | By default in dwm the status of Caps Lock and Num Lock is ignored 7 | when handling keybindings. 8 | 9 | To achieve this dwm will, for each button and key binding, subscribe 10 | to all four combinations of the Caps and Num Lock states, then when 11 | interpreting the key and button press events the lock states are 12 | discarded by the CLEANMASK macro. 13 | 14 | This patch changes this logic so that a user can, if they so desire, 15 | have keybindings that are only active when the Caps Lock or Num Lock 16 | are active - while still ignoring the Caps Lock and Num Lock states 17 | for general keybindings. 18 | 19 | As an example the following button bindings would allow the user to 20 | move and resize windows using only the mouse buttons when Caps Lock 21 | is on (i.e. no need to hold down a modifier key): 22 | 23 | { ClkClientWin, LockMask, Button1, movemouse, {0} }, 24 | { ClkClientWin, LockMask, Button2, togglefloating, {0} }, 25 | { ClkClientWin, LockMask, Button3, resizemouse, {0} }, 26 | 27 | The modifier for Num Lock is usually Mod2Mask, but check with xmodmap 28 | to be sure. 29 | --- 30 | dwm.c | 6 +++--- 31 | 1 file changed, 3 insertions(+), 3 deletions(-) 32 | 33 | diff --git a/dwm.c b/dwm.c 34 | index e5efb6a..ade5dca 100644 35 | --- a/dwm.c 36 | +++ b/dwm.c 37 | @@ -46,7 +46,7 @@ 38 | 39 | /* macros */ 40 | #define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) 41 | -#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) 42 | +#define MATCHMASK(mod,state) ((state & ~((numlockmask|LockMask) ^ ((numlockmask|LockMask) & mod))) == mod) 43 | #define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \ 44 | * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy))) 45 | #define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) 46 | @@ -454,7 +454,7 @@ buttonpress(XEvent *e) 47 | } 48 | for (i = 0; i < LENGTH(buttons); i++) 49 | if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button 50 | - && CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state)) 51 | + && MATCHMASK(buttons[i].mask, ev->state)) 52 | buttons[i].func(click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg); 53 | } 54 | 55 | @@ -998,7 +998,7 @@ keypress(XEvent *e) 56 | keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); 57 | for (i = 0; i < LENGTH(keys); i++) 58 | if (keysym == keys[i].keysym 59 | - && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) 60 | + && MATCHMASK(keys[i].mod, ev->state) 61 | && keys[i].func) 62 | keys[i].func(&(keys[i].arg)); 63 | } 64 | -- 65 | 2.45.2 66 | 67 | -------------------------------------------------------------------------------- /dwm/dwm-lock_masks-6.5.diff: -------------------------------------------------------------------------------- 1 | From a492ae788e399fe80fb9ed54faa89ca1606018dd Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:26:29 +0200 4 | Subject: [PATCH] lockmask patch 5 | 6 | By default in dwm the status of Caps Lock and Num Lock is ignored 7 | when handling keybindings. 8 | 9 | To achieve this dwm will, for each button and key binding, subscribe 10 | to all four combinations of the Caps and Num Lock states, then when 11 | interpreting the key and button press events the lock states are 12 | discarded by the CLEANMASK macro. 13 | 14 | This patch changes this logic so that a user can, if they so desire, 15 | have keybindings that are only active when the Caps Lock or Num Lock 16 | are active - while still ignoring the Caps Lock and Num Lock states 17 | for general keybindings. 18 | 19 | As an example the following button bindings would allow the user to 20 | move and resize windows using only the mouse buttons when Caps Lock 21 | is on (i.e. no need to hold down a modifier key): 22 | 23 | { ClkClientWin, LockMask, Button1, movemouse, {0} }, 24 | { ClkClientWin, LockMask, Button2, togglefloating, {0} }, 25 | { ClkClientWin, LockMask, Button3, resizemouse, {0} }, 26 | 27 | The modifier for Num Lock is usually Mod2Mask, but check with xmodmap 28 | to be sure. 29 | --- 30 | dwm.c | 6 +++--- 31 | 1 file changed, 3 insertions(+), 3 deletions(-) 32 | 33 | diff --git a/dwm.c b/dwm.c 34 | index f1d86b2..ded3652 100644 35 | --- a/dwm.c 36 | +++ b/dwm.c 37 | @@ -46,7 +46,7 @@ 38 | 39 | /* macros */ 40 | #define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) 41 | -#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) 42 | +#define MATCHMASK(mod,state) ((state & ~((numlockmask|LockMask) ^ ((numlockmask|LockMask) & mod))) == mod) 43 | #define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \ 44 | * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy))) 45 | #define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) 46 | @@ -453,7 +453,7 @@ buttonpress(XEvent *e) 47 | } 48 | for (i = 0; i < LENGTH(buttons); i++) 49 | if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button 50 | - && CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state)) 51 | + && MATCHMASK(buttons[i].mask, ev->state)) 52 | buttons[i].func(click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg); 53 | } 54 | 55 | @@ -1007,7 +1007,7 @@ keypress(XEvent *e) 56 | keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); 57 | for (i = 0; i < LENGTH(keys); i++) 58 | if (keysym == keys[i].keysym 59 | - && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) 60 | + && MATCHMASK(keys[i].mod, ev->state) 61 | && keys[i].func) 62 | keys[i].func(&(keys[i].arg)); 63 | } 64 | -- 65 | 2.45.2 66 | 67 | -------------------------------------------------------------------------------- /dwm/dwm-lock_masks-6.6.diff: -------------------------------------------------------------------------------- 1 | From 1d69d1833163003490c02fd3dee2ee4b11541877 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Mon, 1 Jul 2024 22:26:29 +0200 4 | Subject: [PATCH] lockmask patch 5 | 6 | By default in dwm the status of Caps Lock and Num Lock is ignored 7 | when handling keybindings. 8 | 9 | To achieve this dwm will, for each button and key binding, subscribe 10 | to all four combinations of the Caps and Num Lock states, then when 11 | interpreting the key and button press events the lock states are 12 | discarded by the CLEANMASK macro. 13 | 14 | This patch changes this logic so that a user can, if they so desire, 15 | have keybindings that are only active when the Caps Lock or Num Lock 16 | are active - while still ignoring the Caps Lock and Num Lock states 17 | for general keybindings. 18 | 19 | As an example the following button bindings would allow the user to 20 | move and resize windows using only the mouse buttons when Caps Lock 21 | is on (i.e. no need to hold down a modifier key): 22 | 23 | { ClkClientWin, LockMask, Button1, movemouse, {0} }, 24 | { ClkClientWin, LockMask, Button2, togglefloating, {0} }, 25 | { ClkClientWin, LockMask, Button3, resizemouse, {0} }, 26 | 27 | The modifier for Num Lock is usually Mod2Mask, but check with xmodmap 28 | to be sure. 29 | --- 30 | dwm.c | 6 +++--- 31 | 1 file changed, 3 insertions(+), 3 deletions(-) 32 | 33 | diff --git a/dwm.c b/dwm.c 34 | index 1443802..4430615 100644 35 | --- a/dwm.c 36 | +++ b/dwm.c 37 | @@ -46,7 +46,7 @@ 38 | 39 | /* macros */ 40 | #define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) 41 | -#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) 42 | +#define MATCHMASK(mod,state) ((state & ~((numlockmask|LockMask) ^ ((numlockmask|LockMask) & mod))) == mod) 43 | #define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \ 44 | * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy))) 45 | #define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) 46 | @@ -452,7 +452,7 @@ buttonpress(XEvent *e) 47 | } 48 | for (i = 0; i < LENGTH(buttons); i++) 49 | if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button 50 | - && CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state)) 51 | + && MATCHMASK(buttons[i].mask, ev->state)) 52 | buttons[i].func(click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg); 53 | } 54 | 55 | @@ -1006,7 +1006,7 @@ keypress(XEvent *e) 56 | keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); 57 | for (i = 0; i < LENGTH(keys); i++) 58 | if (keysym == keys[i].keysym 59 | - && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) 60 | + && MATCHMASK(keys[i].mod, ev->state) 61 | && keys[i].func) 62 | keys[i].func(&(keys[i].arg)); 63 | } 64 | -- 65 | 2.50.1 66 | 67 | -------------------------------------------------------------------------------- /dwm/dwm-respectsizehintsrule-6.3.diff: -------------------------------------------------------------------------------- 1 | From 25a850d8df8dedadfd2604d5c749647d7fc07b76 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Thu, 27 Jun 2024 21:33:38 +0200 4 | Subject: [PATCH] respect size hints rule example patch 5 | 6 | --- 7 | config.def.h | 6 +++--- 8 | dwm.c | 6 +++++- 9 | 2 files changed, 8 insertions(+), 4 deletions(-) 10 | 11 | diff --git a/config.def.h b/config.def.h 12 | index a2ac963..cef998a 100644 13 | --- a/config.def.h 14 | +++ b/config.def.h 15 | @@ -26,9 +26,9 @@ static const Rule rules[] = { 16 | * WM_CLASS(STRING) = instance, class 17 | * WM_NAME(STRING) = title 18 | */ 19 | - /* class instance title tags mask isfloating monitor */ 20 | - { "Gimp", NULL, NULL, 0, 1, -1 }, 21 | - { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, 22 | + /* class instance title tags mask respectsizehints isfloating monitor */ 23 | + { "Gimp", NULL, NULL, 0, 1, 1, -1 }, 24 | + { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1 }, 25 | }; 26 | 27 | /* layout(s) */ 28 | diff --git a/dwm.c b/dwm.c 29 | index a96f33c..3c12770 100644 30 | --- a/dwm.c 31 | +++ b/dwm.c 32 | @@ -91,6 +91,7 @@ struct Client { 33 | int oldx, oldy, oldw, oldh; 34 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 35 | int bw, oldbw; 36 | + int respectsizehints; 37 | unsigned int tags; 38 | int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 39 | Client *next; 40 | @@ -137,6 +138,7 @@ typedef struct { 41 | const char *instance; 42 | const char *title; 43 | unsigned int tags; 44 | + int respectsizehints; 45 | int isfloating; 46 | int monitor; 47 | } Rule; 48 | @@ -298,6 +300,7 @@ applyrules(Client *c) 49 | && (!r->class || strstr(class, r->class)) 50 | && (!r->instance || strstr(instance, r->instance))) 51 | { 52 | + c->respectsizehints = r->respectsizehints; 53 | c->isfloating = r->isfloating; 54 | c->tags |= r->tags; 55 | for (m = mons; m && m->num != r->monitor; m = m->next); 56 | @@ -344,7 +347,7 @@ applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact) 57 | *h = bh; 58 | if (*w < bh) 59 | *w = bh; 60 | - if (resizehints || c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) { 61 | + if (c->respectsizehints || c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) { 62 | /* see last two sentences in ICCCM 4.1.2.3 */ 63 | baseismin = c->basew == c->minw && c->baseh == c->minh; 64 | if (!baseismin) { /* temporarily remove base dimensions */ 65 | @@ -1033,6 +1036,7 @@ manage(Window w, XWindowAttributes *wa) 66 | c->w = c->oldw = wa->width; 67 | c->h = c->oldh = wa->height; 68 | c->oldbw = wa->border_width; 69 | + c->respectsizehints = resizehints; 70 | 71 | updatetitle(c); 72 | if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { 73 | -- 74 | 2.45.2 75 | 76 | -------------------------------------------------------------------------------- /dwm/dwm-restrictfocus-6.4.diff: -------------------------------------------------------------------------------- 1 | From fc7fea4eaf2cb0e7188943e7372371fa856d0a97 Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Thu, 27 Jun 2024 18:17:38 +0200 4 | Subject: [PATCH] restrictfocus 5 | 6 | A variant of focusstack that is restricted to 7 | the area (master, stack) the currently focused client is in. 8 | --- 9 | config.def.h | 2 ++ 10 | dwm.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 11 | 2 files changed, 57 insertions(+) 12 | 13 | diff --git a/config.def.h b/config.def.h 14 | index 061ad66..bc30c90 100644 15 | --- a/config.def.h 16 | +++ b/config.def.h 17 | @@ -66,6 +66,8 @@ static const Key keys[] = { 18 | { MODKEY, XK_b, togglebar, {0} }, 19 | { MODKEY, XK_j, focusstack, {.i = +1 } }, 20 | { MODKEY, XK_k, focusstack, {.i = -1 } }, 21 | + { MODKEY|ShiftMask, XK_j, focusstackarea, {.i = +1 } }, 22 | + { MODKEY|ShiftMask, XK_k, focusstackarea, {.i = -1 } }, 23 | { MODKEY, XK_i, incnmaster, {.i = +1 } }, 24 | { MODKEY, XK_d, incnmaster, {.i = -1 } }, 25 | { MODKEY, XK_h, setmfact, {.f = -0.05} }, 26 | diff --git a/dwm.c b/dwm.c 27 | index e5efb6a..88cf993 100644 28 | --- a/dwm.c 29 | +++ b/dwm.c 30 | @@ -169,6 +169,7 @@ static void focus(Client *c); 31 | static void focusin(XEvent *e); 32 | static void focusmon(const Arg *arg); 33 | static void focusstack(const Arg *arg); 34 | +static void focusstackarea(const Arg *arg); 35 | static Atom getatomprop(Client *c, Atom prop); 36 | static int getrootptr(int *x, int *y); 37 | static long getstate(Window w); 38 | @@ -862,6 +863,60 @@ focusstack(const Arg *arg) 39 | } 40 | } 41 | 42 | +void 43 | +focusstackarea(const Arg *arg) 44 | +{ 45 | + Monitor *m = selmon; 46 | + Client *c, *n, *sel = NULL, *next = NULL, *prev = NULL, *first = NULL, *last = NULL; 47 | + int i = 0; 48 | + 49 | + if (m->lt[m->sellt]->arrange == &monocle) { 50 | + focusstack(arg); 51 | + return; 52 | + } 53 | + 54 | + if (!m->sel || (m->sel->isfullscreen && lockfullscreen)) 55 | + return; 56 | + 57 | + for (c = nexttiled(m->clients), i = 1; c; c = n, i++) { 58 | + n = nexttiled(c->next); 59 | + 60 | + if (c == m->sel) 61 | + sel = c; 62 | + 63 | + if (!first || i - 1 == m->nmaster) { 64 | + first = c; 65 | + } 66 | + 67 | + last = c; 68 | + 69 | + if (!sel) 70 | + prev = c; 71 | + 72 | + if (sel && !next) 73 | + next = n; 74 | + 75 | + if (sel && i == m->nmaster) 76 | + break; 77 | + } 78 | + 79 | + if (arg->i > 0) { 80 | + if (sel == last) 81 | + c = first; 82 | + else 83 | + c = next; 84 | + } else { 85 | + if (sel == first) 86 | + c = last; 87 | + else 88 | + c = prev; 89 | + } 90 | + 91 | + if (c) { 92 | + focus(c); 93 | + } 94 | +} 95 | + 96 | Atom 97 | getatomprop(Client *c, Atom prop) 98 | { 99 | -- 100 | 2.45.2 101 | 102 | -------------------------------------------------------------------------------- /dwm/dwm-shiftviewclients-6.2.diff: -------------------------------------------------------------------------------- 1 | From 72fbed3ecf268f09861e65d0255150597db715bb Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Thu, 27 Jun 2024 08:24:23 +0200 4 | Subject: [PATCH] shiftview patch 5 | 6 | This variant of the shiftview patch adds left and right 7 | circular shift through tags, but skips tags where there are no clients. 8 | --- 9 | config.def.h | 2 ++ 10 | dwm.c | 41 +++++++++++++++++++++++++++++++++++++++++ 11 | 2 files changed, 43 insertions(+) 12 | 13 | diff --git a/config.def.h b/config.def.h 14 | index 1c0b587..ad3a5fd 100644 15 | --- a/config.def.h 16 | +++ b/config.def.h 17 | @@ -72,6 +72,8 @@ static Key keys[] = { 18 | { MODKEY, XK_l, setmfact, {.f = +0.05} }, 19 | { MODKEY, XK_Return, zoom, {0} }, 20 | { MODKEY, XK_Tab, view, {0} }, 21 | + { MODKEY|ShiftMask, XK_Tab, shiftviewclients, { .i = +1 } }, 22 | + { MODKEY|ShiftMask, XK_backslash, shiftviewclients, { .i = -1 } }, 23 | { MODKEY|ShiftMask, XK_c, killclient, {0} }, 24 | { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, 25 | { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, 26 | diff --git a/dwm.c b/dwm.c 27 | index 4465af1..55d5035 100644 28 | --- a/dwm.c 29 | +++ b/dwm.c 30 | @@ -203,6 +203,7 @@ static void setlayout(const Arg *arg); 31 | static void setmfact(const Arg *arg); 32 | static void setup(void); 33 | static void seturgent(Client *c, int urg); 34 | +static void shiftviewclients(const Arg *arg); 35 | static void showhide(Client *c); 36 | static void sigchld(int unused); 37 | static void spawn(const Arg *arg); 38 | @@ -1610,6 +1611,46 @@ seturgent(Client *c, int urg) 39 | XFree(wmh); 40 | } 41 | 42 | +void 43 | +shiftviewclients(const Arg *arg) 44 | +{ 45 | + Arg shifted; 46 | + Client *c; 47 | + unsigned int tagmask = 0; 48 | + 49 | + for (c = selmon->clients; c; c = c->next) 50 | + #if SCRATCHPADS_PATCH 51 | + if (!(c->tags & SPTAGMASK)) 52 | + tagmask = tagmask | c->tags; 53 | + #else 54 | + tagmask = tagmask | c->tags; 55 | + #endif // SCRATCHPADS_PATCH 56 | + 57 | + #if SCRATCHPADS_PATCH 58 | + shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK; 59 | + #else 60 | + shifted.ui = selmon->tagset[selmon->seltags]; 61 | + #endif // SCRATCHPADS_PATCH 62 | + if (arg->i > 0) // left circular shift 63 | + do { 64 | + shifted.ui = (shifted.ui << arg->i) 65 | + | (shifted.ui >> (LENGTH(tags) - arg->i)); 66 | + #if SCRATCHPADS_PATCH 67 | + shifted.ui &= ~SPTAGMASK; 68 | + #endif // SCRATCHPADS_PATCH 69 | + } while (tagmask && !(shifted.ui & tagmask)); 70 | + else // right circular shift 71 | + do { 72 | + shifted.ui = (shifted.ui >> (- arg->i) 73 | + | shifted.ui << (LENGTH(tags) + arg->i)); 74 | + #if SCRATCHPADS_PATCH 75 | + shifted.ui &= ~SPTAGMASK; 76 | + #endif // SCRATCHPADS_PATCH 77 | + } while (tagmask && !(shifted.ui & tagmask)); 78 | + 79 | + view(&shifted); 80 | +} 81 | + 82 | void 83 | showhide(Client *c) 84 | { 85 | -- 86 | 2.45.2 87 | 88 | -------------------------------------------------------------------------------- /dwm/dwm-shiftviewclients-6.3.diff: -------------------------------------------------------------------------------- 1 | From 7978da9c0e163bb2079f46bb359881c97d607a7a Mon Sep 17 00:00:00 2001 2 | From: Bakkeby 3 | Date: Thu, 27 Jun 2024 08:24:56 +0200 4 | Subject: [PATCH] shiftview patch 5 | 6 | This variant of the shiftview patch adds left and right 7 | circular shift through tags, but skips tags where there are no clients. 8 | --- 9 | config.def.h | 2 ++ 10 | dwm.c | 41 +++++++++++++++++++++++++++++++++++++++++ 11 | 2 files changed, 43 insertions(+) 12 | 13 | diff --git a/config.def.h b/config.def.h 14 | index a2ac963..ad7cabe 100644 15 | --- a/config.def.h 16 | +++ b/config.def.h 17 | @@ -73,6 +73,8 @@ static Key keys[] = { 18 | { MODKEY, XK_l, setmfact, {.f = +0.05} }, 19 | { MODKEY, XK_Return, zoom, {0} }, 20 | { MODKEY, XK_Tab, view, {0} }, 21 | + { MODKEY|ShiftMask, XK_Tab, shiftviewclients, { .i = +1 } }, 22 | + { MODKEY|ShiftMask, XK_backslash, shiftviewclients, { .i = -1 } }, 23 | { MODKEY|ShiftMask, XK_c, killclient, {0} }, 24 | { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, 25 | { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, 26 | diff --git a/dwm.c b/dwm.c 27 | index a96f33c..0f8fd34 100644 28 | --- a/dwm.c 29 | +++ b/dwm.c 30 | @@ -204,6 +204,7 @@ static void setlayout(const Arg *arg); 31 | static void setmfact(const Arg *arg); 32 | static void setup(void); 33 | static void seturgent(Client *c, int urg); 34 | +static void shiftviewclients(const Arg *arg); 35 | static void showhide(Client *c); 36 | static void sigchld(int unused); 37 | static void spawn(const Arg *arg); 38 | @@ -1614,6 +1615,46 @@ seturgent(Client *c, int urg) 39 | XFree(wmh); 40 | } 41 | 42 | +void 43 | +shiftviewclients(const Arg *arg) 44 | +{ 45 | + Arg shifted; 46 | + Client *c; 47 | + unsigned int tagmask = 0; 48 | + 49 | + for (c = selmon->clients; c; c = c->next) 50 | + #if SCRATCHPADS_PATCH 51 | + if (!(c->tags & SPTAGMASK)) 52 | + tagmask = tagmask | c->tags; 53 | + #else 54 | + tagmask = tagmask | c->tags; 55 | + #endif // SCRATCHPADS_PATCH 56 | + 57 | + #if SCRATCHPADS_PATCH 58 | + shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK; 59 | + #else 60 | + shifted.ui = selmon->tagset[selmon->seltags]; 61 | + #endif // SCRATCHPADS_PATCH 62 | + if (arg->i > 0) // left circular shift 63 | + do { 64 | + shifted.ui = (shifted.ui << arg->i) 65 | + | (shifted.ui >> (LENGTH(tags) - arg->i)); 66 | + #if SCRATCHPADS_PATCH 67 | + shifted.ui &= ~SPTAGMASK; 68 | + #endif // SCRATCHPADS_PATCH 69 | + } while (tagmask && !(shifted.ui & tagmask)); 70 | + else // right circular shift 71 | + do { 72 | + shifted.ui = (shifted.ui >> (- arg->i) 73 | + | shifted.ui << (LENGTH(tags) + arg->i)); 74 | + #if SCRATCHPADS_PATCH 75 | + shifted.ui &= ~SPTAGMASK; 76 | + #endif // SCRATCHPADS_PATCH 77 | + } while (tagmask && !(shifted.ui & tagmask)); 78 | + 79 | + view(&shifted); 80 | +} 81 | + 82 | void 83 | showhide(Client *c) 84 | { 85 | -- 86 | 2.45.2 87 | 88 | --------------------------------------------------------------------------------