From d04a72d219d160b3feebc2cf48d356fba18cf69a Mon Sep 17 00:00:00 2001
From: cowmonk Most likely, you’ll want If you’re on a Debian-based system (like Mint), you can usually get this and other essential tools by installing For Arch users (for the “I use Arch btw” furries): And for Fedora folks: This is a build automation tool that will, well, “make” dwm for you. It usually comes with the DWM interacts with the X Window System, so you’ll need the development headers for it. Often called something like Debian: Arch: Fedora: (Note: Got all that? Sweet! This is where the magic happens, folks. Now, config.h is your personal configuration file. Open it up with your favorite text editor. You’ll see C arrays defining your keys, your tags, your fonts, your colors.
It might look a bit intimidating at first, but it’s surprisingly straightforward. Still in your dwm directory? Good. Time to compile!
This is the part that sounds scary but is usually super simple thanks to the Makefile. To compile and install it system-wide: Or, if you prefer not to install it system-wide immediately yet (which is a good idea for testing): If all your prerequisites were met, this should complete without errors. You’ll now have a dwm executable file in the directory (and runnable in your terminal if
you ran the system wide installation)! To run dwm, you’ll typically need to configure your .xinitrc file to launch it.
For example, you could add this line to your ~/.xinitrc: For the people who run a Display Manager which is more likely (i.e gdm, sddm, lightdm, etc.). You’ll need to create a .desktop file.
This file basically has the information and stuff for the thing to see and run it. You’ll need to create one in the /usr/share/xsessions/.
And here’s an example dwm.desktop for reference: /usr/share/xsessions/dwm.desktop: The default keybinding for the Terminal is Alt+Shift+Return. Any other keybindings can be found in config.h, it shouldn’t be hard to
understand the giant struct declaration. Comments left by the suckless team are your friends! Read them!A C Compiler:
gcc. It’s the most common C compiler everyone gets.build-essential. $ sudo apt install build-essential
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo apt install build-essential |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
$ sudo pacman -S base-devel
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo pacman -S base-devel |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
$ sudo dnf groupinstall "Development Tools" "Development Libraries"
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo dnf group install "Development Tools" "Development Libraries" |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
Make:
build-essential or base-devel packages.LibX11 development files:
libx11-dev or libX11-devel. $ sudo apt install libx11-dev libxft-dev libxinerama-dev
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo apt install libx11-dev libxft-dev libxinerama-dev |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
$ sudo pacman -S libx11 libxft libxinerama
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo pacman -S libx11 libxft libxinerama |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
$ sudo dnf install libX11-devel libXft-devel libXinerama-devel
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo dnf install libX11-devel libXft-devel libXinerama-devel |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
libxft-dev is for font rendering and libxinerama-dev is handy for multi-monitor setups, which you’ll probably want later on!)config.h
config.def.h is the default configuration. You’re not supposed to edit this directly. Instead, you copy it to config.h: $ cp config.def.h config.h
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ cp config.def.h config.h |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
$ sudo make clean install
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo make clean install |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
$ make
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ make |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
exec dwm
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| exec dwm |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
[Desktop Entry]
-Encoding=UTF-8
-Name=dwm
-Comment=Dynamic window manager
-Exec=dwm
-Icon=dwm
-Type=XSession
+┌────────────────────────────────────┐
+| [Destop Entry] |
+| Encoding=UTF-8 |
+| Name=dwm |
+| Comment=Dynamic window manager |
+| Exec=dwm |
+| Icon=dwm |
+| Type=XSession |
+└────────────────────────────────────┘
Find a Patch: Head over to the dwm patches page. Find a patch you like. Let’s say you want the autostart patch, which allows you to run commands automatically when dwm starts (I highly reccomend this especially if you’re running from a display manager!).
Download the Patch: Download the .diff file for the patch. Save it somewhere, perhaps in a patches subdirectory within your dwm source folder.
Apply the Patch: In your dwm source directory, use the patch command:
Apply the Patch: In your dwm source directory, use the patch command:
patch -Np1 -i patchfile.diff
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ patch -Np1 -i /path/to/patchfile.diff |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
Resolve Conflicts (If Any): Sometimes, patches might conflict, especially if they modify the same lines of code or if you’re applying a patch meant
@@ -145,7 +169,9 @@ for an older version of dwm. This will result in .rej (rejected) files. You̵
at the .rej files to see what couldn’t be applied. This is the trickiest part, but it gets easier with practice. Start with simple, popular patches.
Recompile: After applying a patch (and resolving any conflicts), you need to recompile!
- $ sudo make clean install
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo make clean install |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
And that’s the patching dance! It can be a bit fiddly, especially when patches conflict, but it gives you incredible control over your window manager.
Also, a quick note! Some patches might change the config.def.h, add these new changes to your config.h since they are default configs for the new patches.
diff --git a/blog4.html b/blog4.html
index c348192..b7c6657 100644
--- a/blog4.html
+++ b/blog4.html
@@ -65,26 +65,38 @@ See, once you have a working system, there isn’t a need to keep on configu
A C Compiler:
Most likely, you’ll want gcc. It’s the most common C compiler everyone gets.
If you’re on a Debian-based system (like Mint), you can usually get this and other essential tools by installing build-essential.
- $ sudo apt install build-essential
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo apt install build-essential |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
For Arch users (for the “I use Arch btw” furries):
- $ sudo pacman -S base-devel
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo pacman -S base-devel |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
And for Fedora folks:
- $ sudo dnf groupinstall "Development Tools" "Development Libraries"
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo dnf group install "Development Tools" "Development Libraries" |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
Make:
This is a build automation tool that will, well, “make” dwm for you. It usually comes with the build-essential or base-devel packages.
LibX11 development files:
DWM interacts with the X Window System, so you’ll need the development headers for it. Often called something like libx11-dev or libX11-devel.
Debian:
- $ sudo apt install libx11-dev libxft-dev libxinerama-dev
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo apt install libx11-dev libxft-dev libxinerama-dev |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
Arch:
- $ sudo pacman -S libx11 libxft libxinerama
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo pacman -S libx11 libxft libxinerama |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
Fedora:
- $ sudo dnf install libX11-devel libXft-devel libXinerama-devel
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo dnf install libX11-devel libXft-devel libXinerama-devel |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
(Note: libxft-dev is for font rendering and libxinerama-dev is handy for multi-monitor setups, which you’ll probably want later on!)
Got all that? Sweet!
@@ -101,7 +113,9 @@ However I recommend personally to get their official The Infamous config.h
This is where the magic happens, folks. config.def.h is the default configuration. You’re not supposed to edit this directly. Instead, you copy it to config.h:
- $ cp config.def.h config.h
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ cp config.def.h config.h |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
Now, config.h is your personal configuration file. Open it up with your favorite text editor. You’ll see C arrays defining your keys, your tags, your fonts, your colors.
It might look a bit intimidating at first, but it’s surprisingly straightforward.
@@ -110,28 +124,36 @@ It might look a bit intimidating at first, but it’s surprisingly straightf
Still in your dwm directory? Good. Time to compile!
This is the part that sounds scary but is usually super simple thanks to the Makefile.
To compile and install it system-wide:
- $ sudo make clean install
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo make clean install |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
Or, if you prefer not to install it system-wide immediately yet (which is a good idea for testing):
- $ make
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ make |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
If all your prerequisites were met, this should complete without errors. You’ll now have a dwm executable file in the directory (and runnable in your terminal if
you ran the system wide installation)!
To run dwm, you’ll typically need to configure your .xinitrc file to launch it.
For example, you could add this line to your ~/.xinitrc:
- exec dwm
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| exec dwm |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
For the people who run a Display Manager which is more likely (i.e gdm, sddm, lightdm, etc.). You’ll need to create a .desktop file.
This file basically has the information and stuff for the thing to see and run it. You’ll need to create one in the /usr/share/xsessions/.
And here’s an example dwm.desktop for reference:
/usr/share/xsessions/dwm.desktop:
-[Desktop Entry]
-Encoding=UTF-8
-Name=dwm
-Comment=Dynamic window manager
-Exec=dwm
-Icon=dwm
-Type=XSession
+┌────────────────────────────────────┐
+| [Destop Entry] |
+| Encoding=UTF-8 |
+| Name=dwm |
+| Comment=Dynamic window manager |
+| Exec=dwm |
+| Icon=dwm |
+| Type=XSession |
+└────────────────────────────────────┘
The default keybinding for the Terminal is Alt+Shift+Return. Any other keybindings can be found in config.h, it shouldn’t be hard to
understand the giant struct declaration. Comments left by the suckless team are your friends! Read them!
@@ -157,9 +179,11 @@ package manager. Once you’ve done that here are the general steps:
Find a Patch: Head over to the dwm patches page. Find a patch you like. Let’s say you want the autostart patch,
which allows you to run commands automatically when dwm starts (I highly reccomend this especially if you’re running from a display manager!).
Download the Patch: Download the .diff file for the patch. Save it somewhere, perhaps in a patches subdirectory within your dwm source folder.
-Apply the Patch: In your dwm source directory, use the patch command:
+Apply the Patch: In your dwm source directory, use the patch command:
- patch -Np1 -i patchfile.diff
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ patch -Np1 -i /path/to/patchfile.diff |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
Resolve Conflicts (If Any): Sometimes, patches might conflict, especially if they modify the same lines of code or if you’re applying a patch meant
@@ -167,7 +191,9 @@ for an older version of dwm. This will result in .rej (rejected) files. You̵
at the .rej files to see what couldn’t be applied. This is the trickiest part, but it gets easier with practice. Start with simple, popular patches.
Recompile: After applying a patch (and resolving any conflicts), you need to recompile!
- $ sudo make clean install
+┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
+| $ sudo make clean install |
+└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
And that’s the patching dance! It can be a bit fiddly, especially when patches conflict, but it gives you incredible control over your window manager.
Also, a quick note! Some patches might change the config.def.h, add these new changes to your config.h since they are default configs for the new patches.