257 lines
8.3 KiB
HTML
257 lines
8.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self'; font-src 'self' data:; img-src 'self' data:; connect-src 'self'; base-uri 'self'; form-action 'self' https://defcon.social https://bsky.app;">
|
|
<meta http-equiv="X-Content-Type-Options" content="nosniff">
|
|
<link rel="stylesheet" href="../assets/css/style.css">
|
|
<link rel="icon" type="image/x-icon" href="../favicon.ico">
|
|
<script>
|
|
// Apply theme immediately to prevent flash
|
|
(function() {
|
|
const theme = localStorage.getItem('theme') ||
|
|
(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
document.documentElement.setAttribute('data-theme', theme);
|
|
})();
|
|
</script>
|
|
<title>dwm Cheatsheet - Cheatsheets - Launch Pad</title>
|
|
</head>
|
|
<body>
|
|
<button class="theme-toggle" id="themeToggle" aria-label="Toggle dark mode">
|
|
<svg class="theme-icon theme-icon-moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
|
|
<svg class="theme-icon theme-icon-sun" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: none;"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>
|
|
</button>
|
|
<br/><br/>
|
|
<div class="name">
|
|
__ _______________________ _________._________________________
|
|
\_ _____/ \______ \ / _ \ / _____/ / _____/ | | \_ _____/
|
|
| __) | _/ / /_\ \ / \ ___ / \ ___ | | | __)_
|
|
| \ | | \ / | \ \ \_\ \ \ \_\ \ | |___ | \
|
|
\___ / |____|_ / \____|__ / \______ / \______ / |_______ \ /_______ /
|
|
\/ \/ \/ \/ \/ \/ \/
|
|
</div>
|
|
<div class="blog-page-header">
|
|
<div class="blog-header-content">
|
|
<a href="/cheatsheets" class="back-link" title="Back to Cheatsheets">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 24 24" class="home-icon"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>
|
|
</a>
|
|
<h1 class="blog-page-title">dwm Cheatsheet</h1>
|
|
</div>
|
|
</div>
|
|
<div class="blog-post-container">
|
|
<div class="blog-posts-container" style="max-width: 900px; margin: 0 auto;">
|
|
<div class="blog-post">
|
|
<div class="blog-post-content">
|
|
<p><a href="index.html">← Back to cheatsheets</a></p>
|
|
<p><a href="../index.html">← Home</a></p>
|
|
<hr>
|
|
<p>dwm (Dynamic Window Manager) is a minimal, tiling window manager for X11.</p>
|
|
<hr>
|
|
<h2>Application Launch</h2>
|
|
<ul>
|
|
<li>Mod+Return - Launch terminal</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Shift+Return - Launch terminal (swap with master)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+P - Launch dmenu (application launcher)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Shift+P - Launch dmenu (alternative)</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Window Management</h2>
|
|
<ul>
|
|
<li>Mod+C - Close focused window</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Shift+C - Close window (alternative)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+M - Toggle monocle (fullscreen)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+F - Toggle floating</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+T - Toggle tiled layout</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Space - Zoom (swap focused with master)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Shift+Space - Toggle floating</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Window Navigation</h2>
|
|
<ul>
|
|
<li>Mod+J - Focus next window</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+K - Focus previous window</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Tab - Focus next window</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Shift+Tab - Focus previous window</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+H - Focus stack (backward)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+L - Focus stack (forward)</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Window Resizing</h2>
|
|
<ul>
|
|
<li>Mod+H - Decrease master area size</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+L - Increase master area size</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Shift+H - Decrease number of master windows</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Shift+L - Increase number of master windows</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+I - Increase number of windows in master area</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+D - Decrease number of windows in master area</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Window Movement</h2>
|
|
<ul>
|
|
<li>Mod+Shift+J - Move window down in stack</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Shift+K - Move window up in stack</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Shift+H - Move window to master area</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Shift+L - Move window to stack area</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Tags (Workspaces)</h2>
|
|
<ul>
|
|
<li>Mod+1-9 - View tag</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Shift+1-9 - Move window to tag</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Ctrl+1-9 - Toggle tag view</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+0 - View all tags</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Shift+0 - Make window appear on all tags</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Layouts</h2>
|
|
<ul>
|
|
<li>Mod+T - Tiled layout</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Shift+T - Tiled layout (alternative)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+M - Monocle layout (fullscreen)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+F - Floating layout</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Shift+F - Floating layout (alternative)</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>System</h2>
|
|
<ul>
|
|
<li>Mod+Shift+Q - Quit dwm</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+B - Toggle status bar</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Mod+Shift+B - Toggle status bar (alternative)</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Configuration</h2>
|
|
<h3>Config File Location</h3>
|
|
<ul>
|
|
<li>~/.config/dwm/config.h (source config)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>config.def.h in dwm source directory</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Must recompile after changes</li>
|
|
</ul>
|
|
<h3>Example Key Bindings</h3>
|
|
<p>Customize in config.h:</p>
|
|
<pre><code>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} },
|
|
};</code></pre>
|
|
<h3>Change Modifier Key</h3>
|
|
<pre><code>#define MODKEY Mod1Mask // Alt key
|
|
// or
|
|
#define MODKEY Mod4Mask // Super/Windows key</code></pre>
|
|
<hr>
|
|
<h2>Tips</h2>
|
|
<ul>
|
|
<li>MODKEY is Mod1Mask (Alt) by default, often changed to Mod4Mask (Super)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Tags act like workspaces - windows can be on multiple tags</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Layouts: tiled, floating, monocle (fullscreen)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Must recompile dwm after config changes</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Use patches to extend functionality</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Status bar shows tags, layout, window title</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Very minimal - everything configured in source code</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Use dmenu for application launching</li>
|
|
</ul>
|
|
<hr>
|
|
<p><a href="index.html">← Back to cheatsheets</a></p>
|
|
<p><a href="../index.html">← Home</a></p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script async type="text/javascript" src="../blog/analytics.js"></script>
|
|
<script src="../theme.js"></script>
|
|
</body>
|
|
</html> |