diff options
| author | Don Williams <don.e.williams@gmal.com> | 2026-08-06 20:30:45 -0400 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-08-29 21:41:34 -0700 |
| commit | 47eeca0ea806c9bd4a0911d0d0d30bca254e07b7 (patch) | |
| tree | 989936fc99733a2ebee088354604dc0eb0bd8db2 /scripts | |
| parent | 4f49b43a30483ab152d6201182310cf01de87eb5 (diff) | |
Fixed migrate script for disabled monitors
Signed-off-by: Don Williams <don.e.williams@gmal.com>
On branch development
Your branch is up to date with 'origin/development'.
Changes to be committed:
modified: CHANGELOG.md
modified: scripts/migrate-hypr-to-lua.sh
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/migrate-hypr-to-lua.sh | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/scripts/migrate-hypr-to-lua.sh b/scripts/migrate-hypr-to-lua.sh index 75a61db9..fb729d7e 100755 --- a/scripts/migrate-hypr-to-lua.sh +++ b/scripts/migrate-hypr-to-lua.sh @@ -530,6 +530,8 @@ def parse_startup(path, *, variables=None, visited=None): return entries MONITOR_DIRECTIVE_KEYS = { + "disable", + "disabled", "mirror", "bitdepth", "transform", @@ -559,6 +561,7 @@ MONITOR_DIRECTIVE_KEYS = { } MONITOR_FIELD_MAP = { + "disable": "disabled", "addreserved": "reserved", "supportswidecolor": "supports_wide_color", "supportshdr": "supports_hdr", @@ -591,7 +594,7 @@ def parse_monitors(path): mode_or_directive = parts[1].lower().replace("-", "_") extras = [] - if mode_or_directive == "disable": + if mode_or_directive in {"disable", "disabled"}: spec["mode"] = "disable" entries.append(spec) continue @@ -623,6 +626,15 @@ def parse_monitors(path): ] i += 5 continue + if field == "disabled": + if i + 1 >= len(extras): + spec["disabled"] = "true" + i += 1 + continue + value = extras[i + 1].strip() + spec["disabled"] = value if value else "true" + i += 2 + continue if i + 1 >= len(extras): i += 1 @@ -710,6 +722,14 @@ def emit_monitor(spec): f" output = {lua_string(spec.get('output', ''))},", ] + mode_value = str(spec.get("mode", "")).strip().lower() + disabled_value = str(spec.get("disabled", "")).strip().lower() + disabled_truthy = {"1", "true", "yes", "on", "disable", "disabled"} + if mode_value in {"disable", "disabled"} or disabled_value in disabled_truthy: + lines.append(" mode = \"disable\",") + lines.append("})") + return "\n".join(lines) + if "mode" in spec: lines.append(f" mode = {lua_string(spec['mode'])},") if "position" in spec: |
