Edit Qtile safely
Goal
Change Qtile configuration at its durable source, regenerate owned outputs, and verify syntax and behavior before reloading the live window manager.
Workflow
Discover the root with
QTILE_CONFIG_ROOT, defaulting to$HOME/.config/qtile. Read its local instructions before editing.Classify the target before changing it:
qtile-ai.orgis the canonical source forconfig.py.qtile-openrouter.orgis the canonical source forqtile_openrouter.py.- Standalone Python, Elisp, and shell helpers are edited at their own source.
- Never make a lasting change only in a generated
config.pyorqtile_openrouter.py.
Search the source and nearby tests for the behavior. Preserve existing ownership, keybinding, event-loop, and display/server conventions.
Edit the canonical source. For an Org source, tangle from that file:
emacs --batch --quick qtile-ai.org --funcall org-babel-tangle emacs --batch --quick qtile-openrouter.org --funcall org-babel-tangleTangle only the source that changed when possible.
Verify generated parity and syntax from the configuration root:
python -m py_compile config.py qtile_telemetry.py qtile check -c config.pyRun the narrowest relevant tests, then the full Qtile suite when practical. Tests must check behavior and source/generated parity, not only file existence.
Invoke
qtile-reloadonly after validation passes, then invokeqtile-confirmfor any visual or runtime-facing change.
Rules
- Keep keybindings documented in their canonical literate source.
- Do not hardcode a monitor, network interface, display, username, or hostname when runtime discovery or an existing configuration abstraction is available.
- Do not block Qtile’s event loop with Git, network, or long-running commands.
- Do not overwrite unrelated work in a dirty tree.
- Do not commit or merge unless the user explicitly requests it.