bakkeby / dwm-flexipatch Goto Github PK
View Code? Open in Web Editor NEWA dwm build with preprocessor directives to decide which patches to include during build time
License: MIT License
A dwm build with preprocessor directives to decide which patches to include during build time
License: MIT License
I've been trying to build this with the Warp patch but I'm getting this error.
patch/warp.c:16:19: error: ‘Monitor’ has no member named ‘by’; did you mean ‘my’?
16 | (y > c->mon->by && y < c->mon->by + bh) ||
| ^~
| my
patch/warp.c:16:37: error: ‘Monitor’ has no member named ‘by’; did you mean ‘my’?
16 | (y > c->mon->by && y < c->mon->by + bh) ||
| ^~
| my
patch/warp.c:17:13: error: ‘Monitor’ has no member named ‘topbar’
17 | (c->mon->topbar && !y))
| ^~
Currently this is the only patch I have enabled.
How can I create seperate color schemes for each tag? Say all tags bg the same bug tag1 is red tag2 is green tag3 is yellow etc?
this project is a non C dwm wannabe user's dream :) can I share some love for this on Reddit and various forums?
Hi, Thank you for all the work you put on to build these amazing automation as well as some pretty good patches.
I've noticed however, that the Flextile delux patch, sometimes gets the layouts misaligned, for example:
I tryed understanding the patch but it is quite hard and as it doesn't have any comment, it becomes really complicated, do you envision refurbishing it in a near future?
Thank you once more.
Please include the https://dwm.suckless.org/patches/moveresize/ patch
Thanks
there seems to be a bug when I enable the cfacts patch, after opening many windows in the stack, the bottom border of the last window in the stack is like moving around, and it's creating a gap between it and the edge of the screen ... this doesn't happen without the dwmc patch, had to backward patch my build to figure out where the bug came from :)
when I switch to monocle gaps are disabled ... can you make it in such a way to respect gaps so that we can have monocle window with gaps?
also, when i toggle on / off gaps, it toggles them on all tags regardelss of the pertag patch, it would be good to have the ability to have gaps on on 1 tag in 1 layout and gaps off in a different layout on a different tag ...
^^
Hey dude, can you add this patch please when you have time.
https://dwm.suckless.org/patches/launcher/
But create a new enum so each launcher created can have a different color, i.e; 'blue-surf green-spotifytui orange-firefox' etc
Just for completeness. Would it be possible to add
https://dwm.suckless.org/patches/pertag/dwm-pertag-perseltag-6.2.diff
hey bakkeby, im stuck again with a couple of patches that conflicts with systray and other patches.
the status2d
patch wants me to
- drw_setscheme(drw, scheme[SchemeNorm]);
- tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
- drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
+ tw = m->ww - drawstatusbar(m, bh, stext);
and i have in my dwm.c
this
drw_setscheme(drw, scheme[SchemeNorm]);
sw = TEXTW(stext) - lrpad / 2 + 2; /* 2px right padding */
drw_text(drw, m->ww - sw - stw, 0, sw, bh, lrpad / 2 - 2, stext, 0);
and the attachaside
patch wants me to
-#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]))
+#define ISVISIBLEONTAG(C, T) ((C->tags & T))
+#define ISVISIBLE(C) ISVISIBLEONTAG(C, C->mon->tagset[C->mon->seltags])
and i have this
#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]) || C->issticky)
#define LENGTH(X) (sizeof X / sizeof X[0])
and cfacts
patch wants me to do
- h = (m->wh - my) / (MIN(n, m->nmaster) - i);
+ h = (m->wh - my) * (c->cfact / mfacts);
and i have in my dwm.c
h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx;
should i just do this?
h = (m->wh - my) * (c->cfact / mfacts) - m->gappx;
could you include the stacker patch? I got addicted to it, it's especially useful when using the centered floating master as the main layout :D
Hi again, not sure which version of swallow patch you are using, but it doesn't 'swallow' on FreeBSD. Perhaps you can upgrade it to this version which has FreeBSD support also?
https://dwm.suckless.org/patches/swallow/dwm-swallow-20200522-7accbcf.diff
Hi dude, can you make a pertag save layouts patch so whatever layout I set my tags to when I quit dwm the layouts are saved for the tags. Then when I start dwm next, the tags are the same layouts I last set them to instead of all reverting back to the first layout (tiled usually).
when including vanitygaps patch on top of the listed patches bellow I get this make error
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION="6.2" -DXINERAMA LDFLAGS = -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lXrender CC = cc cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"6.2\" -DXINERAMA drw.c cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"6.2\" -DXINERAMA dwm.c In file included from patch/include.c:179, from dwm.c:470: patch/tile.c: In function ‘tile’: patch/tile.c:12:2: warning: implicit declaration of function ‘getgaps’; did you mean ‘setgaps’? [-Wimplicit-function-declaration] 12 | getgaps(m, &oh, &ov, &ih, &iv, &n); | ^~~~~~~ | setgaps cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"6.2\" -DXINERAMA util.c cc -o dwm drw.o dwm.o util.o -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lXrender /usr/bin/ld: dwm.o: in function
tile':
dwm.c:(.text+0xc1e): undefined reference to getgaps' collect2: error: ld returned 1 exit status make: *** [Makefile:26: dwm] Error 1
patches included in this error are
patches that I have enabled
ALPHA
ATTACHBOTTOM
AUTORESIZE
AWESOMEBAR
CENTER
CFACTS
CYCLELAYOUTS
EWMHTAGS
HIDEVACANTTAGS
IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT
MOVESTACK
NODMENU
PERTAG
SCRATCHPAD
SYSTRAY
SWITCHTAG
TOGGLEFULLSCREEN
VANITYGAPS
WINDOWROLERULE
ZOOMSWAP
patches included in 2nd error are
ALPHA
ATTACHBOTTOM
AUTORESIZE
AWESOMEBAR
CENTER
CFACTS
CYCLELAYOUTS
EWMHTAGS
HIDEVACANTTAGS
IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT
MOVESTACK
NODMENU
PERTAG
SCRATCHPAD
SYSTRAY
SWITCHTAG
TOGGLEFULLSCREEN
VANITYGAPS
WINDOWROLERULE
ZOOMSWAP
CENTEREDMASTER_LAYOUT
DECK_LAYOUT
MONOCLE_LAYOUT
TILE_LAYOUT
and ran the flexipatch finalizer on top of the 2nd combination of patches
dwm build options:
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION="6.2" -DXINERAMA
LDFLAGS = -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lXrender
CC = cc
cp config.def.h config.h
cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"6.2\" -DXINERAMA drw.c
cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"6.2\" -DXINERAMA dwm.c
dwm.c: In function ‘zoom’:
dwm.c:2377:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
2377 | if (!selmon->lt[selmon->sellt]->arrange
| ^~
dwm.c:2383:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
2383 | if (c == nexttiled(selmon->clients)) {
| ^~
cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"6.2\" -DXINERAMA util.c
cc -o dwm drw.o dwm.o util.o -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lXrender
I have no clue what this means mate
or how to fix it
Just a small bug I've noticed, when using the systray patch together with alpha, icons have a ugly black background. Changing the following code
/* use parents background color */
swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
XChangeWindowAttributes(dpy, c->win, CWBackPixel, &swa);
To something like;
swa.background_pixel = "#282828";
Should change the color, however alpha ignores that and prints black #000000. Disabling alpha patch makes systray use SchemeNorm bar bg color again.
Perhaps there is some wizardry you can conjure up to make these 2 patches play nicely together.
so, this morning I woke up, and my Browser was on all 9 tags on its own, while none of the tags were toggled ... the browser was supposed to sit on its own on tag 2, but it was present on tag 1 2 3 4 5 6 7 8 9 while tag 2 wasn't tagged (I hope I'm explaining this correctly)
this bug is present since I discovered flexipatch, although I'm not sure which patch is causing it, I suspect it is the switchtag patch as I have been using it since day 1, but not entirely sure ...
many times before I had similar situations, where a window on 1 tag was present on 2+ more tags while I didn't toggle it to be present, and if I close that window on any of the tags, it gets closed on all tags, first i taught it is a error on my side, but just today i realized it was a bug since I just left my browser last night on tag 2, and it was on all 9 today
basically it is as if i have toggled a window to be sticky, while it's not sticky, I'm not even using the sticky patch
for some reason the no swallow settings are not being respected when using xorg-xev to checkout my key press symbols, it gets swallowed, I'm unable to figure out why, but on Luke's dwm it doesn't get swallowed with the same settings
dwm build options:
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION="6.2" -DXINERAMA
LDFLAGS = -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lXrender
CC = cc
cp patches.def.h patches.h
cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"6.2\" -DXINERAMA drw.c
cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"6.2\" -DXINERAMA dwm.c
In file included from dwm.c:283:
config.h:42:79: warning: excess elements in struct initializer
42 | { "Gimp", NULL, NULL, 0, 1, 0, 0, -1 },
| ^
config.h:42:79: note: (near initialization for ‘rules[0]’)
config.h:42:90: warning: excess elements in struct initializer
42 | { "Gimp", NULL, NULL, 0, 1, 0, 0, -1 },
| ^
config.h:42:90: note: (near initialization for ‘rules[0]’)
config.h:43:79: warning: excess elements in struct initializer
43 | { "Firefox", NULL, NULL, 1 << 8, 0, 0, 0, -1 },
| ^
config.h:43:79: note: (near initialization for ‘rules[1]’)
config.h:43:90: warning: excess elements in struct initializer
43 | { "Firefox", NULL, NULL, 1 << 8, 0, 0, 0, -1 },
| ^
config.h:43:90: note: (near initialization for ‘rules[1]’)
dwm.c: In function ‘drawbar’:
dwm.c:743:56: error: ‘tagsalt’ undeclared (first use in this function); did you mean ‘tags’?
743 | wdelta = selmon->alttag ? abs(TEXTW(tags[i]) - TEXTW(tagsalt[i])) / 2 : 0;
| ^~~~~~~
dwm.c:59:61: note: in definition of macro ‘TEXTW’
59 | #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
| ^
dwm.c:743:56: note: each undeclared identifier is reported only once for each function it appears in
743 | wdelta = selmon->alttag ? abs(TEXTW(tags[i]) - TEXTW(tagsalt[i])) / 2 : 0;
| ^~~~~~~
dwm.c:59:61: note: in definition of macro ‘TEXTW’
59 | #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
| ^
In file included from patch/include.c:2,
from dwm.c:285:
At top level:
patch/alternativetags.c:2:1: warning: ‘togglealttag’ defined but not used [-Wunused-function]
2 | togglealttag()
| ^~~~~~~~~~~~
make: *** [Makefile:18: dwm.o] Error 1
do you accept patch proposals on which to include in the flexipatch buid? and feature requests to add some minor functionality to those patches about a idea I have?
I'm not a C programmer, or a programmer at all, I'm just a good tinkerer, I managed to make some of the manual patches work, but some I just cant seem to get to, so ... I switched to flexipatch and love it ... just that ... would like to see some additional patches on the list, but neither of them are on the suckless website ...
for example the
dwm-switchview (ill have to upload that ... in addition it needs keyboard bindings, for example on voidrice dwm where this patch is included, it is bound to mod+g and mod+semicolon I think, and to mod+page up and mod+page down, it basically cycles the view between tags in left and right direction similar like the default view function, but it isn't limited to between 2 tags, it cycles all the tags in 1 or the other direction...
what I would like to see in a dwm scratchpad (regardless of if on one you already included or on this one
suggested) is that, you can spawn programs directly in to an scratchpad, so for example, when I press mod+A that it opens a bc calculator in the scratchpad, and that when I press mod+alt+t that it opens tmux in a scratchpad, and when I press mod+v that it opens vim in scratchpad, and to be able to define more of these ... maybe with awindow rule to always start a program in the scratchpad, something like "isscratchpad" or a custom command variable, or i dunno, I can do this on i3 ... what do you think?
I requested the feature on the author's github page, but he threw me off telling me to to do it my self and I don't know C :D multiple scratchpads question
or to include such functionality, in the original suckless scratchpad
I got a few other good patches that arent for some reason listed on suckless.org, but I wont burn time suggesting them, until I see that your open to including requested patches and extending the patch library :)
This patch is a port of InstantWM's on_empty_keys.
It allows you to configure key bindings for empty workspaces. Like so:
static const char* firefoxcmd[] = {"firefox", NULL};
static Key on_empty_keys[] = {
/* modifier key function argument */
{ 0, XK_f, spawn, {.v = firefoxcmd } },
};
patch:
diff --git a/config.def.h b/config.def.h
index 1c0b587..2da2290 100644
--- a/config.def.h
+++ b/config.def.h
@@ -113,3 +113,9 @@ static Button buttons[] = {
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};
+static const char* firefoxcmd[] = {"firefox", NULL};
+static Key on_empty_keys[] = {
+ /* modifier key function argument */
+ { 0, XK_f, spawn, {.v = firefoxcmd } },
+};
+
diff --git a/dwm.c b/dwm.c
index 664c527..11bfaf0 100644
--- a/dwm.c
+++ b/dwm.c
@@ -141,6 +141,9 @@ typedef struct {
int monitor;
} Rule;
+
+static int isempty;
+
/* function declarations */
static void applyrules(Client *c);
static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact);
@@ -804,6 +807,16 @@ focus(Client *c)
}
selmon->sel = c;
drawbars();
+
+ if (!c){
+ if (!isempty) {
+ isempty = 1;
+ grabkeys();
+ }
+ } else if (isempty) {
+ isempty = 0;
+ grabkeys();
+ }
}
/* there are some broken focus acquiring clients needing extra handling */
@@ -961,6 +974,14 @@ grabkeys(void)
for (j = 0; j < LENGTH(modifiers); j++)
XGrabKey(dpy, code, keys[i].mod | modifiers[j], root,
True, GrabModeAsync, GrabModeAsync);
+
+ if(!selmon->sel) {
+ for (i = 0; i < LENGTH(on_empty_keys); i++)
+ if ((code = XKeysymToKeycode(dpy, on_empty_keys[i].keysym)))
+ for (j = 0; j < LENGTH(modifiers); j++)
+ XGrabKey(dpy, code, on_empty_keys[i].mod | modifiers[j], root,
+ True, GrabModeAsync, GrabModeAsync);
+ }
}
}
@@ -997,6 +1018,13 @@ keypress(XEvent *e)
&& CLEANMASK(keys[i].mod) == CLEANMASK(ev->state)
&& keys[i].func)
keys[i].func(&(keys[i].arg));
+ if(!selmon->sel) {
+ for (i = 0; i < LENGTH(on_empty_keys); i++)
+ if (keysym == on_empty_keys[i].keysym
+ && CLEANMASK(on_empty_keys[i].mod) == CLEANMASK(ev->state)
+ && on_empty_keys[i].func)
+ on_empty_keys[i].func(&(on_empty_keys[i].arg));
+ }
}
void
Hello,
Can you help me to modify holdbar patch to get into effect only when I have used togglebar
to hide status bar and always show status bar when bar is visible using togglebar
? Holdbar patch is very useful but sometimes I need to see details on status bar constantly and that time togglebar
doesn't show status bar and it is too tedious to hold down a key constantly.
By looking at this repo, I though you could be the right person. Please suggest something. Thanks in advance! :)
Extra information
I use a custom bar using xsetroot
.
im sorry if this not the right place to ask for help for this but im facing a issue where the dwm-systray-6.2.diff
patch and dwm-statuscmd-signal-6.2.diff
patch are not able merge properly in dwm.c as
the dwm-systray-6.2.diff
patch want me to do this-
@@ -439,7 +475,7 @@ buttonpress(XEvent *e)
arg.ui = 1 << i;
} else if (ev->x < x + blw)
click = ClkLtSymbol;
- else if (ev->x > selmon->ww - TEXTW(stext))
+ else if (ev->x > selmon->ww - TEXTW(stext) - getsystraywidth())
click = ClkStatusText;
else
click = ClkWinTitle;
and the dwm-statuscmd-signal-6.2.diff
wants me to do this
@@ -439,9 +445,26 @@ buttonpress(XEvent *e)
arg.ui = 1 << i;
} else if (ev->x < x + blw)
click = ClkLtSymbol;
- else if (ev->x > selmon->ww - TEXTW(stext))
+ else if (ev->x > (x = selmon->ww - TEXTW(stext) + lrpad)) {
click = ClkStatusText;
- else
+
+ char *text = rawstext;
+ int i = -1;
+ char ch;
+ dwmblockssig = 0;
+ while (text[++i]) {
+ if ((unsigned char)text[i] < ' ') {
+ ch = text[i];
+ text[i] = '\0';
+ x += TEXTW(text) - lrpad;
+ text[i] = ch;
+ text += i+1;
+ i = -1;
+ if (x >= ev->x) break;
+ dwmblockssig = ch;
+ }
+ }
+ } else
click = ClkWinTitle;
im not sure how to combine this line else if (ev->x > selmon->ww - TEXTW(stext) - getsystraywidth())
and else if (ev->x > (x = selmon->ww - TEXTW(stext) + lrpad)) {
as i want to use both the systray and i need statuscmd-signal for the dwmblocks for clickable status bar.
i have it like this right now
// else if (ev->x > selmon->ww - TEXTW(stext) - getsystraywidth())
// click = ClkStatusText;
else if (ev->x > (x = selmon->ww - TEXTW(stext) + lrpad)) {
click = ClkStatusText;
i have comment out the first to lines because status bar wont recognize clicks if that line is enabled. after commenting out im able to click on statusbar just fine but having some positioning issues like the from left to right clock battery and volume modules appear on statusbar to click on volume i need to click on battery because i have 1 icon in the systray so its causing positioning issues. maybe im wrong. i can send u my configs and screenshots if necessary.
BTW im using everything vanilla patched everything myself not using flexipatch.
Hello Stein,
I've tried numerous patches all working without problem, with just one query concerning scratvchpads. There are three alternitves in flexipatch. Two are variations of the same patch, I believe; SCRATCHPAD_PATCH and SCRATCHPAD_KEEP_POSITION_AND_SIZE_PATCH, which I beleive both use the included 3 'scratchpad' key mappings in config.def.h, along with 3 user-defined scratchpads, bound to MOD1 xkb_grave.
I haven't been able to get these to work, even after trying different key mappings subsituting the given xkb_grave for, e.g. xkb_apostrophe, and xkb_minus, which should work on my keybopard setup.
All other key mappings work, for all other patches I've tried, inlcuding for the SCRATCHPAD_ALT_1_PATCH (i.e xkb_minus, xkb_=), which works fine as a scratchpad in dwm_flexipatch.
My preference is for the 'named' scratchpads thoughi due ot their persistence, not the _ALT_PATCH. And, scratchpads are particlulary neat and useful to me (important).
So, I wonder if you can confirm they are working as applied by flexipatch, and if they are, why I ma be getting this non-functionality.
==== btw. I'm enjoying use of your flexipatch. It has helped me explore functionality although I'm a 1 year long user of dwm with patches.
Kind Regards,
John
seems that the xrdb patch here is not compatible with python-pywal color schemes, which I find weird, as when I applied the xrdb patch and generate a pywal color scheme on standard dwm + xrdb it works ... am I overlooking something here? if im not ... can you make the XRDB patch compatible with pywal color schemes? :)
when using the centered floating master, and toggling the fakefullscreen_client patch, about 10-15% of the fullscreen window gets cut off from the actual window size, refreshing the window (for example Brave Browser) doesn't rescale it to the new centered floating master size, only way I was able to get it to rescale the window to fit it all in fake full screen was to switch to tile layout then back to centered floating master with the fakefullscreen_client toggled ... if your unable to replicate what I'm talking about or don't understand ill record a new video :)
When using bar alpha and systray patches together the systray background always shows as black;
Possible fix to include: https://www.reddit.com/r/suckless/comments/fw7yhn/dwm_alpha_systray_artifacts/
I find the Center floating master a very useful layout for my workflow, but due to resizehints 1 some windows in the stack are sized unequally, I noticed that with Mod+Shift+H/L with the cfacts patch enabled enables the user to resize the windows in the stack, but one issue I have with it is every time I press the keybindings to change the cfact it pulls the master window from the background back on top of everything ....
best scenario to reproduce this is to use CENTEREDFLOATINGMASTER_PATCH / layout and open 3 windows (for example Brave, Discord, and a file manager) place 1 in the master, then MOD+J 2x to put the master in the background, and then Mod+Shift+H & Mod+Shift+L to change cfacts, every time you change cfat it will pull up the master back to focus ...
it would be good if changing cfact wouldn't pull the master back in to focus
This patch centers newly spawned float windows by default:
diff --git a/dwm.c b/dwm.c
index 664c527..b3a2621 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1040,6 +1040,9 @@ manage(Window w, XWindowAttributes *wa)
applyrules(c);
}
+ if (c->x == selmon->wx) c->x += (c->mon->ww - WIDTH(c)) / 2 - c->bw;
+ if (c->y == selmon->wy) c->y += (c->mon->wh - HEIGHT(c)) / 2 - c->bw;
+
if (c->x + WIDTH(c) > c->mon->mx + c->mon->mw)
c->x = c->mon->mx + c->mon->mw - WIDTH(c);
if (c->y + HEIGHT(c) > c->mon->my + c->mon->mh)
awesomebar, fancybar, systray patches are incompatible with barpadding patch
awesomebar + barpadding or fancybar + barpadding: the title bars overlap the right side status bar for some reason
systray+barpadding: systray gets stuck floating in the top right corner instead of next to the statusbar
awesomebar/fancybar + barpadding
just barpadding (what my statusbar should show)
Please include this patch which draws a border around the vanilla dwm bar to match like window borders
https://codemadness.org/paste/dwm-border-bar.patch
Example screenshot: https://i.redd.it/mqzxl88fz3051.png
When the scratchpad patch is added, the tagmask is altered, so to get a window onto all tags you have to do ~SPTAGSMASK
instead of ~0
, because otherwise, your window gets centred/the previous scratchpad position if the scratchpad remember patch is applied, this should be in a small comment either in the config.h
or in the patches.h
can't build with the following patch list
❯ make
dwm build options:
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION="6.2" -DXINERAMA
LDFLAGS = -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lX11-xcb -lxcb -lxcb-res
CC = cc
cp config.def.h config.h
cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"6.2\" -DXINERAMA drw.c
cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"6.2\" -DXINERAMA dwm.c
cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"6.2\" -DXINERAMA util.c
cc -o dwm drw.o dwm.o util.o -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lX11-xcb -lxcb -lxcb-res
/usr/bin/ld: dwm.o: undefined reference to symbol 'XRenderFindVisualFormat'
/usr/bin/ld: /usr/lib/libXrender.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:26: dwm] Error 1
I haven't tried this and dunno if it works or not, cuz lately I'm exhausted from all the patch testing in here, need a break, but had an idea that if it's not already possible, that it could be a good idea, to have a patch that works with DRAGMFACT + DRAGCFACT, eg so that you can drag CFACTS with your mouse as well :)
btw: Glad I'm keeping you busy :D
would love it if you would make this scratchpad available dwm-scratchpad
it's different to the scratchpad that's already included in a way that it allows you to send any window to the scratchpad, eg the scratchpad is not limited to terminal apps only :)
Sorry to bug you again, but I've found a potential bug with the pango patch. First off there is no 'pango.c/h' file in the 'patch' directory if that could be it? But when enabled in patches.def.h and compiling I get this error:
ld: error: undefined symbol: pango_font_metrics_get_height
referenced by drw.c
drw.o:(drw_font_create)
did something about cfacts change? it's behaving unexpectedly with me, I don't remember it being like this ... what i mean is ... windows in the stack, for example, if i have 2 windows in the stack, and MOD+SHIFT+L on the first window and expand that window, when I try to return it with MOD+SHIFT+R it wont do it, and the other way around as well, the only way I can do it, is if I actually focus the 2nd window in the stack, and then move it in the counter direction ... i remember being able to change cfacts in both directions on the same window
Hi, I recently updated my dwm build with your files and noticed something odd. For some reason, the module that's at the far right can only be clicked while the other modules are ignored. I tried looking around for a solution but couldn't get it. This used to work on an earlier build of yours. I don't know if has to do with the barrules that is in the dwm.c file. Thanks for reading!
I dunno if this is in the combination with the stacker patch that you just made and I applied it, or in general a bug in the centered floating master, but when you open 4 windows in the centered floating master layout and you then want to close them (killclient) the first 3 windows in the layout get closed, but the 4th wont no matter how many times I press the killclient button, then when I change from tag 1 to tag 2, and back to tag 1, i am able to kill the client that was stuck as a 4th window
A patch, that adds a _IS_FLOATING xproperty for floating windows,
so you can add compositor rules accordingly, for example (with a picom fork with rounded corners) adding this to your picom.conf
rounded-corners-exclude = [ "! _IS_FLOATING@:32c = 1" ];
rounds all floating windows
patch:
diff --git a/dwm.c b/dwm.c
index 664c527..2e05488 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1075,6 +1075,10 @@ manage(Window w, XWindowAttributes *wa)
arrange(c->mon);
XMapWindow(dpy, c->win);
focus(NULL);
+
+ Atom target = XInternAtom(dpy, "_IS_FLOATING", 0);
+ unsigned int floating[1] = {c->isfloating};
+ XChangeProperty(dpy, c->win, target, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)floating, 1);
}
void
@@ -1720,6 +1724,10 @@ togglefloating(const Arg *arg)
resize(selmon->sel, selmon->sel->x, selmon->sel->y,
selmon->sel->w, selmon->sel->h, 0);
arrange(selmon);
+
+ Atom target = XInternAtom(dpy, "_IS_FLOATING", 0);
+ unsigned int floating[1] = {selmon->sel->isfloating};
+ XChangeProperty(dpy, selmon->sel->win, target, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)floating, 1);
}
v
I am using your default bindings for stacker, while on mod+shift+w I have bound to launch my browser, and on mod+shift+e I have bound to launch neomutt, and modshift+s I have bound to launch scratchpad, and mod+shift+a to launch alsamixer, in the last 24h when I wanted to launch one of them my dwm completely restarts on its own and gets me back to the login screen, but this doesn't happen every time, it's totally random
I assume that it's because
MOD + STACKKEY is a focus function
MOD + SHIFT + STACKKEY is push function
and even thou the mod + w e s a z are not using the push function they seem to be automatically bound to the stack keys completely rendering the MOD+SHIFT+W/E/S/A/Z useless...
could a workaround for this be created? eg to be able to use mod+shift+w/e/s/a/z for other bindings while using mod+w+e+s+a+z for the stackkeys?
althou I would use e r s a z as default keybindings in the stacker patch, or e r a z x, as 99% of ppl will use mod+w for the browser :)
We could verify if this is what is causing the dwm restart issue, but I dunno how to start dwm with a crash log :D
em... the following patches combined together result in a broken dwm, but the make process shows no errors ... I am confused
#define AWESOMEBAR_PATCH 1
#define BARPADDING_PATCH 1
#define CENTER_PATCH 1
#define CFACTS_PATCH 1
#define DWMC_PATCH 1
#define EWMHTAGS_PATCH 1
#define FAKEFULLSCREEN_CLIENT_PATCH 1
#define HIDEVACANTTAGS_PATCH 1
#define NODMENU_PATCH 1
#define PERTAG_PATCH 1
#define SCRATCHPAD_PATCH 1
#define SHIFTVIEW_PATCH 1
#define SYSTRAY_PATCH 1
#define TAGINTOSTACK_ONEMASTER_PATCH 1
#define TAGMONFIXFS_PATCH 1
#define TOGGLEFULLSCREEN_PATCH 1
#define VANITYGAPS_PATCH 1
#define WINDOWROLERULE_PATCH 1
#define XRDB_PATCH 1
#define ZOOMSWAP_PATCH 1
#define CENTEREDFLOATINGMASTER_LAYOUT 1
#define DECK_LAYOUT 1
#define TILE_LAYOUT 1
with the following patches selected
$ sudo make clean install
[sudo] password for kronikpillow:
rm -f dwm drw.o dwm.o util.o dwm-6.2.tar.gz
dwm build options:
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION="6.2" -DXINERAMA
LDFLAGS = -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lXrender
CC = cc
cp config.def.h config.h
cp patches.def.h patches.h
cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"6.2\" -DXINERAMA drw.c
cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"6.2\" -DXINERAMA dwm.c
dwm.c: In function ‘drawbar’:
dwm.c:1567:23: error: ‘boxw’ undeclared (first use in this function)
1567 | drw_rect(drw, x + boxw, 0, w - ( 2 * boxw + 1), boxw, m->sel->isfixed, 0);
| ^~~~
dwm.c:1567:23: note: each undeclared identifier is reported only once for each function it appears in
In file included from patch/include.h:161,
from dwm.c:411:
dwm.c: At top level:
patch/fibonacci.h:1:13: warning: ‘dwindle’ declared ‘static’ but never defined [-Wunused-function]
1 | static void dwindle(Monitor *m);
| ^~~~~~~
make: *** [Makefile:18: dwm.o] Error 1
I have this enhanced fakefullscreen
patch that enables tiling fullscreen only when it's needed made by Aaron Duxler (made ru_gaps
patch as well). This patch is not published though. I'm not a C developer and struggled with patches a bit, so these repos are a godsend. Is it ever a good idea to apply patches to dwm-flexipatch
such as this one?
Also, since it's gibberish to me, if you could add these functionalities to the patch, I would really appreciate it:
the patch tries to distinguish between tiling fullscreen (two or more visible clients) and normal fullscreen (single visible client including monocle mode):
mpv
if "F" is pressed twice.chromium
, as opposed to firefox
, does not adapt itself to the limited viewport automatically in tiling fullscreen. I fix this by moving its position on the stack.diff -up a/dwm.c b/dwm.c
--- a/dwm.c 2019-09-26 12:43:27.579531242 +0200
+++ b/dwm.c 2019-09-26 21:54:20.177938682 +0200
@@ -1476,12 +1476,17 @@ setfullscreen(Client *c, int fullscreen)
XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
c->isfullscreen = 1;
- c->oldstate = c->isfloating;
- c->oldbw = c->bw;
- c->bw = 0;
- c->isfloating = 1;
- resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
- XRaiseWindow(dpy, c->win);
+ if ( selmon->lt[selmon->sellt]->arrange == &monocle ||
+ (nexttiled(selmon->clients) != NULL &&
+ nexttiled(nexttiled(selmon->clients)->next) == NULL))
+ {
+ c->oldstate = c->isfloating;
+ c->oldbw = c->bw;
+ c->bw = 0;
+ c->isfloating = 1;
+ resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
+ XRaiseWindow(dpy, c->win);
+ }
} else if (!fullscreen && c->isfullscreen){
XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
PropModeReplace, (unsigned char*)0, 0);
https://dwm.suckless.org/patches/pango/dwm-pango-6.0.diff won't apply to dwm-6.2, because too much code structure has changed.
I only turned on alpha in the patches config to test out and I get the following error:
https://pastebin.com/9GcgAG5d
EDIT: this is not a dwm-fexipatch issue.
when I enable swallow patch this is what i get
$ make
dwm build options:
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION="6.2" -DXINERAMA
LDFLAGS = -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lXrender
CC = cc
cp config.def.h config.h
cp patches.def.h patches.h
cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE
-D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"6.2\" -DXINERAMA drw.c
cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE
-D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"6.2\" -DXINERAMA dwm.c
cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE
-D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"6.2\" -DXINERAMA util.c
cc -o dwm drw.o dwm.o util.o -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lXrender
/usr/bin/ld: dwm.o: in function `manage':
dwm.c:(.text+0x39dc): undefined reference to `xcb_res_query_client_ids'
/usr/bin/ld: dwm.c:(.text+0x39ef): undefined reference to `xcb_res_query_client_ids_reply'
/usr/bin/ld: dwm.c:(.text+0x39ff): undefined reference to `xcb_res_query_client_ids_ids_iterator'
/usr/bin/ld: dwm.c:(.text+0x3a2c): undefined reference to `xcb_res_client_id_value_value'
/usr/bin/ld: dwm.c:(.text+0x3a39): undefined reference to `xcb_res_client_id_value_next'
/usr/bin/ld: dwm.o: in function `main':
dwm.c:(.text.startup+0xae): undefined reference to `XGetXCBConnection'
collect2: error: ld returned 1 exit status
make: *** [Makefile:29: dwm] Error 1```
IF FAKEFULLSCREEN definitions not set in the default config, the patch doesn't apply
there is only #if FAKEFULLSCREEN_CLIENT_PATCH
also the FAKEFULLSCREEN.c gets deleted when running flexipatch finalized, and I assume that the patch doesn't apply since everything goes missing
Hay there, I suggest splitting config.h to categorical-based files or modules such as keybinds, appearance, navigation ..... and perhaps, misc.
This will make it so much easier to access and edit . And if possible let the value of whether to include exclude a plugin be in the same file at the top. For example appearance.h has two sections one for related patches and the other for the logic.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.