WebsiteTemplate/cheatsheets/qtile.html
2026-01-25 11:33:37 -04:00

274 lines
9.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>qtile 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">qtile 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>qtile is a full-featured, hackable tiling window manager written in Python.</p>
<hr>
<h2>Application Launch</h2>
<ul>
<li>Mod+Return - Launch terminal</li>
</ul>
<ul>
<li>Mod+P - Application launcher (rofi/dmenu)</li>
</ul>
<ul>
<li>Mod+Shift+P - Application launcher (alternative)</li>
</ul>
<hr>
<h2>Window Management</h2>
<ul>
<li>Mod+W - Close focused window</li>
</ul>
<ul>
<li>Mod+Shift+C - Close window (alternative)</li>
</ul>
<ul>
<li>Mod+F - Toggle fullscreen</li>
</ul>
<ul>
<li>Mod+Shift+F - Toggle floating</li>
</ul>
<ul>
<li>Mod+M - Minimize window</li>
</ul>
<ul>
<li>Mod+Shift+M - Restore minimized window</li>
</ul>
<hr>
<h2>Window Navigation</h2>
<ul>
<li>Mod+J or Mod+↓ - Focus down</li>
</ul>
<ul>
<li>Mod+K or Mod+↑ - Focus up</li>
</ul>
<ul>
<li>Mod+H or Mod+← - Focus left</li>
</ul>
<ul>
<li>Mod+L or Mod+→ - Focus right</li>
</ul>
<ul>
<li>Mod+Space - Switch focus between panes (stack layout)</li>
</ul>
<ul>
<li>Mod+Tab - Switch to next window</li>
</ul>
<ul>
<li>Mod+Shift+Tab - Switch to previous window</li>
</ul>
<hr>
<h2>Window Movement</h2>
<ul>
<li>Mod+Shift+J or Mod+Shift+↓ - Move window down</li>
</ul>
<ul>
<li>Mod+Shift+K or Mod+Shift+↑ - Move window up</li>
</ul>
<ul>
<li>Mod+Shift+H or Mod+Shift+← - Move window left</li>
</ul>
<ul>
<li>Mod+Shift+L or Mod+Shift+→ - Move window right</li>
</ul>
<ul>
<li>Mod+Shift+Space - Swap window with master</li>
</ul>
<hr>
<h2>Window Resizing</h2>
<ul>
<li>Mod+Ctrl+H or Mod+Ctrl+← - Grow window left</li>
</ul>
<ul>
<li>Mod+Ctrl+L or Mod+Ctrl+→ - Grow window right</li>
</ul>
<ul>
<li>Mod+Ctrl+J or Mod+Ctrl+↓ - Grow window down</li>
</ul>
<ul>
<li>Mod+Ctrl+K or Mod+Ctrl+↑ - Grow window up</li>
</ul>
<ul>
<li>Mod+Shift+Equal - Reset window sizes</li>
</ul>
<hr>
<h2>Layouts</h2>
<ul>
<li>Mod+Tab - Switch to next layout</li>
</ul>
<ul>
<li>Mod+Shift+Tab - Switch to previous layout</li>
</ul>
<ul>
<li>Mod+Space - Switch focus (stack layout)</li>
</ul>
<ul>
<li>Mod+Shift+Space - Swap window with master</li>
</ul>
<hr>
<h2>Groups (Workspaces)</h2>
<ul>
<li>Mod+1-9 - Switch to group</li>
</ul>
<ul>
<li>Mod+Shift+1-9 - Move window to group</li>
</ul>
<ul>
<li>Mod+G - Switch to next group</li>
</ul>
<ul>
<li>Mod+Shift+G - Switch to previous group</li>
</ul>
<hr>
<h2>System</h2>
<ul>
<li>Mod+Ctrl+R - Reload qtile config</li>
</ul>
<ul>
<li>Mod+Ctrl+Q - Restart qtile</li>
</ul>
<ul>
<li>Mod+Shift+Q - Shutdown qtile</li>
</ul>
<ul>
<li>Mod+Shift+R - Restart qtile (alternative)</li>
</ul>
<hr>
<h2>Configuration</h2>
<h3>Config File Location</h3>
<ul>
<li>~/.config/qtile/config.py (user config)</li>
</ul>
<ul>
<li>Default config in libqtile/resources/default_config.py</li>
</ul>
<h3>Example Key Bindings</h3>
<p>Customize in config.py:</p>
<pre><code>from libqtile.config import Key
from libqtile.lazy import lazy
mod = &quot;mod4&quot; # Super/Windows key
keys = [
# Application launch
Key([mod], &quot;Return&quot;, lazy.spawn(&quot;kitty&quot;), desc=&quot;Launch terminal&quot;),
Key([mod], &quot;p&quot;, lazy.spawn(&quot;rofi -show drun&quot;), desc=&quot;Application launcher&quot;),
# Window navigation
Key([mod], &quot;j&quot;, lazy.layout.down(), desc=&quot;Move focus down&quot;),
Key([mod], &quot;k&quot;, lazy.layout.up(), desc=&quot;Move focus up&quot;),
Key([mod], &quot;h&quot;, lazy.layout.left(), desc=&quot;Move focus left&quot;),
Key([mod], &quot;l&quot;, lazy.layout.right(), desc=&quot;Move focus right&quot;),
# Window movement
Key([mod, &quot;shift&quot;], &quot;j&quot;, lazy.layout.shuffle_down(), desc=&quot;Move window down&quot;),
Key([mod, &quot;shift&quot;], &quot;k&quot;, lazy.layout.shuffle_up(), desc=&quot;Move window up&quot;),
Key([mod, &quot;shift&quot;], &quot;h&quot;, lazy.layout.shuffle_left(), desc=&quot;Move window left&quot;),
Key([mod, &quot;shift&quot;], &quot;l&quot;, lazy.layout.shuffle_right(), desc=&quot;Move window right&quot;),
# Window management
Key([mod], &quot;w&quot;, lazy.window.kill(), desc=&quot;Close window&quot;),
Key([mod], &quot;f&quot;, lazy.window.toggle_fullscreen(), desc=&quot;Toggle fullscreen&quot;),
Key([mod, &quot;shift&quot;], &quot;f&quot;, lazy.window.toggle_floating(), desc=&quot;Toggle floating&quot;),
# Layouts
Key([mod], &quot;Tab&quot;, lazy.next_layout(), desc=&quot;Switch layouts&quot;),
Key([mod], &quot;space&quot;, lazy.layout.next(), desc=&quot;Switch focus&quot;),
# Groups
Key([mod], &quot;1&quot;, lazy.group[&quot;1&quot;].toscreen(), desc=&quot;Switch to group 1&quot;),
Key([mod, &quot;shift&quot;], &quot;1&quot;, lazy.window.togroup(&quot;1&quot;), desc=&quot;Move window to group 1&quot;),
# System
Key([mod, &quot;control&quot;], &quot;r&quot;, lazy.reload_config(), desc=&quot;Reload config&quot;),
Key([mod, &quot;control&quot;], &quot;q&quot;, lazy.restart(), desc=&quot;Restart qtile&quot;),
Key([mod, &quot;shift&quot;], &quot;q&quot;, lazy.shutdown(), desc=&quot;Shutdown qtile&quot;),
]</code></pre>
<h3>Change Modifier Key</h3>
<pre><code>mod = &quot;mod4&quot; # Super/Windows key
# or
mod = &quot;mod1&quot; # Alt key</code></pre>
<hr>
<h2>Tips</h2>
<ul>
<li>Config is Python - full programming language available</li>
</ul>
<ul>
<li>Use KeyChord for binding sequences/modes</li>
</ul>
<ul>
<li>Supports groups (workspaces) and moving windows between them</li>
</ul>
<ul>
<li>Layouts, widgets, and screen settings all in Python config</li>
</ul>
<ul>
<li>Default layout switching and focus commands use hjkl</li>
</ul>
<ul>
<li>Use lazy.call() for custom functions</li>
</ul>
<ul>
<li>Supports multiple screens/monitors</li>
</ul>
<ul>
<li>Widgets configurable via Python</li>
</ul>
<ul>
<li>Use EzKey helper for simpler key definitions</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>