___________ __________ _____ ________ ________ .____ ___________ \_ _____/ \______ \ / _ \ / _____/ / _____/ | | \_ _____/ | __) | _/ / /_\ \ / \ ___ / \ ___ | | | __)_ | \ | | \ / | \ \ \_\ \ \ \_\ \ | |___ | \ \___ / |____|_ / \____|__ / \______ / \______ / |_______ \ /_______ / \/ \/ \/ \/ \/ \/ \/

dwm Cheatsheet

← Back to cheatsheets

← Home


dwm (Dynamic Window Manager) is a minimal, tiling window manager for X11.


Application Launch

  • Mod+Return - Launch terminal
  • Mod+Shift+Return - Launch terminal (swap with master)
  • Mod+P - Launch dmenu (application launcher)
  • Mod+Shift+P - Launch dmenu (alternative)

Window Management

  • Mod+C - Close focused window
  • Mod+Shift+C - Close window (alternative)
  • Mod+M - Toggle monocle (fullscreen)
  • Mod+F - Toggle floating
  • Mod+T - Toggle tiled layout
  • Mod+Space - Zoom (swap focused with master)
  • Mod+Shift+Space - Toggle floating

Window Navigation

  • Mod+J - Focus next window
  • Mod+K - Focus previous window
  • Mod+Tab - Focus next window
  • Mod+Shift+Tab - Focus previous window
  • Mod+H - Focus stack (backward)
  • Mod+L - Focus stack (forward)

Window Resizing

  • Mod+H - Decrease master area size
  • Mod+L - Increase master area size
  • Mod+Shift+H - Decrease number of master windows
  • Mod+Shift+L - Increase number of master windows
  • Mod+I - Increase number of windows in master area
  • Mod+D - Decrease number of windows in master area

Window Movement

  • Mod+Shift+J - Move window down in stack
  • Mod+Shift+K - Move window up in stack
  • Mod+Shift+H - Move window to master area
  • Mod+Shift+L - Move window to stack area

Tags (Workspaces)

  • Mod+1-9 - View tag
  • Mod+Shift+1-9 - Move window to tag
  • Mod+Ctrl+1-9 - Toggle tag view
  • Mod+0 - View all tags
  • Mod+Shift+0 - Make window appear on all tags

Layouts

  • Mod+T - Tiled layout
  • Mod+Shift+T - Tiled layout (alternative)
  • Mod+M - Monocle layout (fullscreen)
  • Mod+F - Floating layout
  • Mod+Shift+F - Floating layout (alternative)

System

  • Mod+Shift+Q - Quit dwm
  • Mod+B - Toggle status bar
  • Mod+Shift+B - Toggle status bar (alternative)

Configuration

Config File Location

  • ~/.config/dwm/config.h (source config)
  • config.def.h in dwm source directory
  • Must recompile after changes

Example Key Bindings

Customize in config.h:

static Key keys[] = {
    /* modifier                     key        function        argument */
    { MODKEY,                       XK_Return, spawn,          {.v = termcmd } },
    { MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
    { MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
    { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
    { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
    { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
    { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
    { MODKEY,                       XK_space,  zoom,           {0} },
    { MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
    { MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
    { MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
    { MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
    { MODKEY,                       XK_1,      view,           {.ui = 1 << 0} },
    { MODKEY|ShiftMask,             XK_1,      tag,            {.ui = 1 << 0} },
};

Change Modifier Key

#define MODKEY Mod1Mask  // Alt key
// or
#define MODKEY Mod4Mask  // Super/Windows key

Tips

  • MODKEY is Mod1Mask (Alt) by default, often changed to Mod4Mask (Super)
  • Tags act like workspaces - windows can be on multiple tags
  • Layouts: tiled, floating, monocle (fullscreen)
  • Must recompile dwm after config changes
  • Use patches to extend functionality
  • Status bar shows tags, layout, window title
  • Very minimal - everything configured in source code
  • Use dmenu for application launching

← Back to cheatsheets

← Home