Closed har5ha closed 3 years ago
I changed config.mk file
From :
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} ${XRENDER} ${MPDCLIENT} ${XEXTLIB} ${XCBLIBS} ${PANGOLIB}
To:
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} ${XRENDER} ${MPDCLIENT} ${XEXTLIB} ${XCBLIBS} ${PANGOLIB} -lX11-xcb -lxcb -lxcb-res
And now 'make' returns no errors.
So -lX11-xcb -lxcb -lxcb-res
needed to be added to config.mk file as a part of the patch.
Yes, that being this line in config.mk
# Uncomment this for the swallow patch / SWALLOW_PATCH
XCBLIBS = -lX11-xcb -lxcb -lxcb-res
Yes, that being this line in config.mk
# Uncomment this for the swallow patch / SWALLOW_PATCH XCBLIBS = -lX11-xcb -lxcb -lxcb-res
Okay.. My mistake.. never thought I also have to edit/look at "config.mk" along with "config.def.h" and "patches.def.h" when building.
Thanks! for your help.
This can be closed.
Yes it is a bit annoying, but I haven't found a good way using such pre-processor directives for the Makefile.
There should actually be a note about making changes to config.mk in the short description for the swallow patch (as with the alpha patch and others), but I see it is not there.
I'll add that now.
That would definitely help. Thanks!
Actual patch involves setting the noswallow to be set to 0
* class instance title tags mask isfloating isterminal noswallow monitor */
+ { "Gimp", NULL, NULL, 0, 1, 0, 0, -1 },
+ { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1 },
+ { "St", NULL, NULL, 0, 0, 1, 0, -1 },
+ { NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
How do I go about setting this in the "config.def.h" with this patch?
RULE(.class = "St", .noswallow = 0)
You have a choice. Either you set up a traditional table like the above based on the available fields in the Rule struct (depends on what patches you enable), or you use the RULE()
method that is set by default with dwm-flexipatch.
Either is fine. It is just that by using such a table you have to add columns to it if you enable a patch that adds something to the rule section. I used to have such a table with preprocessor directives, but needless to say it was unmaintainable: https://github.com/bakkeby/dwm-flexipatch/blob/ae5c96c2177a5a79a441f1eaa0d20e4d852afee3/config.def.h#L299-L439
As for your proposal:
RULE(.class = "St", .noswallow = 0)
This is perfectly valid, except that it doesn't actually make any diffference as you are setting the value to 0. When you use the RULE()
method then all values are 0 or NULL by default* unless you specify that a certain column should have a specific value.
Including this makes more sense if you want to set noswallow to 1. If you look in dwm.c there are also some helper macros, e.g. NOSWALLOW
and TERMINAL
that sets .noswallow and .isterminal to 1 respectively.
E.g. in my build I have
RULE(.title = "Event Tester" NOSWALLOW)
RULE(.class = "st-256color" TERMINAL)
I could just as well have added .noswallow = 1 here, but the reasoning for using these helper macros is merely so that if I happen to disable the swallow patch (for testing purposes or otherwise) then dwm will still compile fine without complaining that there is no .noswallow field in the Rule struct. The macros simply translate to empty strings if the swallow patch is not enabled.
* (an exception to this is the monitor which defaults to -1
as per the RULE definition in dwm.c)
Thanks for a wonderful explanation.
The following change in config.def.h
did the trick for me.
RULE(.class = "St" TERMINAL)
instead of
RULE(.class = "st-256color" TERMINAL)
How ever I am able to successfully apply the patch (dwm-swallow-20200522-7accbcf.diff from https://dwm.suckless.org/patches/swallow/ ) to dwm 6.2 (26kb) (20190203) from https://dwm.suckless.org/ without any errors.
Can you please look into it. Thanks in advance.