How to management patches in DWM
DWM only have less than 2000 lines of code. If you want to add more functionality for your DWM you need patches.
There are two types of patches:
- The ones that fit to your personal taste
- The ones you think should be included in mainline.
There are also have TWO patch methods.
patch filename format The expected format for patches is:
For git revisions:
The YYYYMMDD date should correspond to the last time the patch has been modified.
For git users:
For git users, use -3 to fix the conflict easily:
For patches formatted with git format-patch:
If faced the ERROR message like this:
You should open file: dwm.c.rej and manual change file’s contents. Good luck.
Fork for your OWN and install
First Step: create a new DIR and clone TWO Repositories.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[yanboyang713@manjaro] ➜ Documents mkdir suckless [yanboyang713@manjaro] ➜ Documents cd suckless [yanboyang713@manjaro] ➜ suckless git clone https://github.com/bakkeby/dwm-flexipatch.git Cloning into 'dwm-flexipatch'... remote: Enumerating objects: 3533, done. remote: Counting objects: 100% (1297/1297), done. remote: Compressing objects: 100% (75/75), done. remote: Total 3533 (delta 1269), reused 1226 (delta 1222), pack-reused 2236 Receiving objects: 100% (3533/3533), 774.86 KiB | 2.15 MiB/s, done. Resolving deltas: 100% (2625/2625), done. [yanboyang713@manjaro] ➜ suckless git clone https://github.com/bakkeby/flexipatch-finalizer.git Cloning into 'flexipatch-finalizer'... remote: Enumerating objects: 46, done. remote: Counting objects: 100% (46/46), done. remote: Compressing objects: 100% (33/33), done. remote: Total 46 (delta 27), reused 30 (delta 12), pack-reused 0 Receiving objects: 100% (46/46), 9.64 KiB | 4.82 MiB/s, done. Resolving deltas: 100% (27/27), done.
cd dwm-flexipatch sudo make clean install
If you have NOT face any ERROR, you can go to next step.
Add Patches For example to include the alpha patch then you would only need to flip this setting from 0 to 1 in patches.h:
#define BAR_ALPHA_PATCH 1
Patches I use:
status_padding attachaside autostart cyclelayouts restartsig rotatestack statusallmons tagothermonitors vanity_gaps status2d
NOTE: dwm can now be restarted without destroying other X windows by pressing the usual Mod-Shift-Q combination.