hyprconf2lua - Knowledge Base
Project: hyprconf2lua
Version: 1.7.0
Description: Convert Hyprland hyprlang .conf files to Lua .lua config format (v0.55+)
Maintainer: Prateek-squadron
License: MIT
Project Overview
hyprconf2lua is a converter that transforms Hyprland configuration files (.conf using hyprlang syntax) into Lua configuration files (.lua) compatible with Hyprland v0.55+.
The converter uses a pipeline architecture:
Input (.conf source)
├── lexer.py → tokenize source into tokens
├── parser.py → parse tokens into AST
├── codegen.py → generate Lua code from AST
└── Output (.lua)
Project Structure
hyprconf2lua/
├── README.md ← This knowledge base
├── pyproject.toml ← Package metadata, version 1.7.0
├── src/
│ ├── hyprconf2lua/
│ │ ├── __init__.py ← __version__ = "1.7.0"
│ │ ├── __main__.py ← Entry point: cli.main()
│ │ ├── cli.py ← CLI: argparse, file I/O, --check, --version
│ │ ├── converter.py ← Pipeline orchestrator: tokenize → parse → codegen
│ │ ├── codegen.py ← Code generator: AST → Lua string output
│ │ ├── lexer.py ← Regex-based tokenizer: 17 token types
│ │ ├── parser.py ← Recursive descent parser: 20+ parse methods
│ │ ├── ast.py ← 21 AST node dataclasses
│ │ ├── mappings.py ← Dispatcher maps, rule maps, flag mappings
│ │ └── mappings.py ← 5 mapping dicts (DISPATCHER_MAP, etc.)
│ └── tests/
│ ├── __init__.py
│ └── test_converter.py ← 106 tests passing
├── dist/ ← Built wheels and sdist
├── example/ ← Example hyprland.conf
├── hyprconf2lua.sh ← Shell wrapper to run without pip install
├── install.sh ← Symlinks hyprconf2lua.sh into PATH
├── LICENSE
├── README.md ← This knowledge base
└── README_kb.md ← (this file)
v1.7.0 Fixes (Released)
All issues from the open PRs have been resolved in release 1.7.0. Here's what was fixed:
#35 - 7 Bug Fixes
- Window rules: match/swap - match criteria and properties were swapped; now correctly separates
match:-prefixed criteria from property rules - Layer rules:
blur=on = trueinvalid Lua fixed; now emitsblur = true - Gestures: nested inside
hl.config()instead ofhl.gesture()→ now emitted as dedicatedhl.gesture({...})calls - Window move binds: emitted raw tables instead of
hl.dsp.window.move(); direction shorthand (l/r/u/d) expanded toleft/right/up/down - resizeactive binds: now maps to
hl.dsp.window.resize({ x, y, relative = true }) - Workspace-restore
+0:+0mapped toworkspace = "+0"instead ofdirection = "+0" - layoutmsg with trailing comment:
layoutmsg, # dwindleno longer parses argument asnil; flagged for manual review instead of crashing
#38 - Windowrule/Layerrule Multi-word Values
workspace = "3 silent"stays as string (not split into array)size = 700 600,move 100%-433 53,opacity 0.9 0.8→ arrays{700, 600},{100%-433, 53},{0.9, 0.8}
#39 - Animations Inside Sections
animation =,bezier =directives insideanimations {}now translate tohl.animation()/hl.curve()statements- on/off flag →
enabled = true/false - styles like
popin 87%preserved asstyle = "popin 87%" - Statements emitted outside the
hl.config({})table (valid Lua)
#40 - Stdin Hyphen Whitespace
grim -c -g "$(slurp)" - | satty --filename -preserves spaces around-and|- Before:
grim -c -g \"$(slurp)\"-| satty --filename-(spaces stripped)
#33 - Comma in Variable Values
$kbNextWs = Ctrl+Super, rightparses correctly →local kbNextWs = "Ctrl+Super, right"- Before:
kbNextWs = { }(empty table)
#32 - rgba() Color Parsing
shadow:color = rgba(0,0,0,0.85)parses correctly- Colon-paths expand to nested tables:
shadow = { color = "rgba(0,0,0,0.85)" }
#42 - movecurrentworkspacetomonitor Dispatcher
- New dispatcher:
hl.dsp.workspace.move({ monitor = "l" })
Test Results
- 106 tests passing (only pre-existing
test_cli_helpfails due to module not being installed in /usr/bin/python path) - All fixes verified against real-world hyprland configs
- Regressions: 0 (all existing tests continue to pass)
How to Build & Test
# From project root
python -m build # Build sdist + wheel
python -m pytest tests/ # Run all 106 tests
python -m hyprconf2lua # CLI help
# Example conversions
hyprconf2lua example/hyprland.conf
Guidelines for AI Agents Working on This Project
Code Style
- Follow existing patterns in
src/hyprconf2lua/ - Use
no_space_before/no_space_aftersets in_join_tokensfor consistent spacing - Keep
MULTI_VALUE_EFFECT_KEYS = {"move", "size", "opacity", "alpha"}for multi-word effect values - Dispatcher maps in
mappings.py- add new dispatchers there
Adding New Dispatchers
- Add to
DISPATCHER_MAPinmappings.pywith(func_string, needs_args) - Handle in
build_dispatcher()andbuild_dispatcher_args()incodegen.py - Add special cases for known patterns (e.g.,
+0→ workspace,l/r/u/d→ directions)
Adding New Rule Types
- Add to
WINDOW_RULE_MAPorLAYER_RULE_MAPinmappings.py - Handle in
visit_windowrule()/visit_layerrule()incodegen.py - Support both old-style (
rule, match:X) and new-style (match:key X) syntax
Adding New Animations/Beziers
- Add
enabledfield toAnimationDirectiveinast.py - Update
parse_animation()inparser.pyto extractenabled,stylefrom comma values - Update
visit_animation()incodegen.pyto usestmt.enabledandstmt.style - Ensure statements are emitted outside
hl.config({})table (seeemit_section_config)
Testing
- Run
python -m pytest tests/to verify all 106 tests pass - Add regression tests in
tests/test_converter.pyfor new fixes - Test with real hyprland configs via
hyprctl configerrors
Recent Changes History
| Version | Date | Key Fixes |
|---|---|---|
| 1.7.0 | 2026-08-24 | All 7 bugs from #35, #38, #39, #40, #33, #32 fixed |
| 1.6.0 | 2026-08-20 | #26-#29 (source path, hyphens, ${} syntax, multiline exec) |
| 1.5.0 | 2026-08-28 | #24/#25 (hyphen→underscore, $HOME→os.getenv) |
Contact & Support
- GitHub: https://github.com/Prateek-squadron/hyprconf2lua
- PyPI: https://pypi.org/project/hyprconf2lua/
- Issues: Use GitHub Issues for bug reports and feature requests
- IRC/Slack: #hyprland on Libera.Chat (project maintainer)
This knowledge base was created for the v1.7.0 release cycle. For the latest updates, check the GitHub repository.
Metadata
Release files for hyprconf2lua 1.8.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hyprconf2lua-1.8.2.tar.gz | 32.5 kB | Without provenance | Details for hyprconf2lua-1.8.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hyprconf2lua-1.8.2-py3-none-any.whl | Python 3 | none | any | Details for hyprconf2lua-1.8.2-py3-none-any.whl |
Total release size: 57.6 kB
Release files / hyprconf2lua-1.8.2.tar.gz
| Download URL | hyprconf2lua-1.8.2.tar.gz |
|---|---|
| Size | 32.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4275f41e7f835d241028fe885518527a73a22605e6fa3e79d795704bb70abcda
|
|
BLAKE2b-256 checksum How to use checksums |
e648aaae54f5810d4717ca8b938692fb140ce99f8894de11da4d3bf6d7f543ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.8
|
Release files / hyprconf2lua-1.8.2-py3-none-any.whl
| Download URL | hyprconf2lua-1.8.2-py3-none-any.whl |
|---|---|
| Size | 25.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9a341bcb93ec25b78033714323143458e8d934c16bda4177568c60f03bb286ea
|
|
BLAKE2b-256 checksum How to use checksums |
fb1e1aae151dcfb694ee0d459e77fee5e23ff2ac5413d54c7f79697ea6e75a30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.8
|
Security for hyprconf2lua 1.8.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.