dwm
"/home/yossef/notes/git/envir_sys/dwm.md"
path: git/envir_sys/dwm.md
- **fileName**: dwm
- **Created on**: 2025-03-26 17:10:24
Dwm Config Explained
Appearance
static const unsigned int borderpx = 1; // border pixel of windows
static const unsigned int snap = 32; // snap pixel
static const int showbar = 1; // 0 means no bar
static const int topbar = 1; // 0 means bottom bar
- borderpx: Controls the window border thickness.
- snap: Defines how close windows need to be to "snap" into place.
- showbar: Enables (1) or disables (0) the status bar.
- topbar: Places the bar at the top (1) or bottom (0).
Fonts and Colors
static const char *fonts[] = { "monospace:size=10" };
static const char dmenufont[] = "monospace:size=10";
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#005577";
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
};
- fonts: Sets the font for window titles.
- dmenufont: Sets the font for dmenu.
- colors: Defines the color schemes for normal and selected windows.
Tagging
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
- tags: Defines workspaces (desktops), labeled from 1 to 9. These can be renamed to "Web", "Code", etc.
Layouts
static const float mfact = 0.55; // factor of master area size [0.05..0.95]
static const int nmaster = 1; // number of clients in master area
static const int resizehints = 1; // 1 means respect size hints in tiled resizals
static const int lockfullscreen = 1; // force focus on the fullscreen window
- mfact: Ratio between master and stack areas.
- nmaster: Number of windows in the master area.
- resizehints: Toggles strict size handling for some apps.
- lockfullscreen: Keeps focus on fullscreen apps (good for games).
static const Layout layouts[] = {
/* symbol arrange function */
{ "[]=", tile }, // first entry is default
{ "><>", NULL }, // no layout function means floating behavior
{ "[M]", monocle },
};
- layouts[]: Defines available layouts: tiling (default), floating, and monocle (fullscreen).
Rules
static const Rule rules[] = {
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, 1, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
};
- rules: Defines behavior for specific apps. For example,
GIMP always floats, and Firefox starts on tag 9.
Keybindings Table
Keybinding | Action |
---|---|
MODKEY + Enter |
Launch terminal |
MODKEY + p |
Launch dmenu |
MODKEY + Shift + q |
Kill focused window |
MODKEY + j/k |
Move focus to next/previous window |
MODKEY + h/l |
Shrink/Expand master window area |
MODKEY + ,/. |
Increase/Decrease number of master panes |
MODKEY + Shift + c |
Close the focused window |
MODKEY + t/f/m |
Switch to tiling/floating/monocle layout |
MODKEY + 1-9 |
Switch to workspace (tag) |
MODKEY + Shift + 1-9 |
Move focused window to workspace (tag) |
MODKEY + Shift + Space |
Toggle floating for focused window |
MODKEY + Shift + r |
Restart DWM |
MODKEY + Shift + e |
Quit DWM |