The audit's first tier, in one change: every case found where the interface
asserted something the system did not do.
Twenty-one compositor-owned preferences -- the whole Mouse & Touchpad page,
plus window layout, snapping, dim-inactive and the magnifier -- had the live
half (hyprctl eval) and not the config-time half, so they quietly reverted on
every hyprctl reload. All 70 hypr-backed keys now have a prefs.get() in the
Lua, and hypr-prefs-contract pins both the presence and that the Lua fallback
equals the schema default, which is how the touchpad page misreported natural
scrolling on first boot.
The idle generator fell back from unwritten battery keys to the AC values
while the Power page displayed the schema defaults: a fresh laptop showed
"suspend at 20 minutes" and generated no suspend listener, then discharged to
zero in a bag. Unwritten keys now use the defaults the page shows
(idle-defaults-contract pins generator to schema; idle-config-contract
re-pinned to the new rule with the tradeoff recorded), and change-settings
enables managed idle on any machine with a battery -- without starting
hypridle in whatever session the installer runs under.
The per-app lock-screen notification switches wrote fields nothing read:
hyprlock cannot render notifications. Removed, with the rule model shrunk to
{enabled}, stale stored fields dropped at normalization, and the contract now
forbidding the page from growing lock-screen switches it cannot honor.
The battery warning thresholds were searchable, documented as "Found on
Power & Lock", and rendered nowhere -- and crossing the low threshold changed
only a glyph's color. Both sliders now exist where search was already sending
people, and low battery publishes a real notification at important priority.
Three handoffs opened GNOME panels that are inert in a Hyprland session. The
keyboard handoff is gone (that panel writes gsettings nothing here reads, and
the working controls sat on the same page); Connectivity gains a Wi-Fi row
that opens GNOME's actual Wi-Fi panel -- hidden SSIDs and 802.1X finally have
a road -- beside the network row that legitimately drives NetworkManager; the
universal-access handoff is gone, its few working toggles being controls this
app already owns. And the accessibility page now gives the true reason sticky
keys are missing: each Wayland compositor implements its own and Hyprland
does not yet -- not "an X11 feature with no Wayland equivalent," which sent
people to the wrong conclusion about the platform.
Claude-Session: https://claude.ai/code/session_01Epx9ZC1gwm81K3jm9x9CKh
44 lines
1.7 KiB
Bash
Executable File
44 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# The idle generator's fallbacks must equal the schema's defaults.
|
|
#
|
|
# The Power page shows the schema default for an unwritten key; panama-idle
|
|
# generates from its own fallback for the same key. When the two disagreed
|
|
# (schema said suspend on battery at 20 minutes, the generator fell back to
|
|
# the AC value, never), a fresh laptop displayed one behavior and shipped
|
|
# another. The UI and the generator read the same file; this pins them to the
|
|
# same defaults too.
|
|
|
|
set -uo pipefail
|
|
|
|
repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
|
|
python3 - "$repo_dir" <<'PY'
|
|
import re, sys, pathlib
|
|
|
|
repo = pathlib.Path(sys.argv[1])
|
|
schema = (repo / "config/dot/quickshell/config/PreferenceSchema.qml").read_text()
|
|
idle = (repo / "config/dot/quickshell/scripts/panama-idle").read_text()
|
|
|
|
def schema_default(key):
|
|
m = re.search(r'key: "' + key + r'".*?def: ([-\d.]+|true|false)', schema, re.S)
|
|
return m.group(1) if m else None
|
|
|
|
failures = []
|
|
# Every read_setting with a literal fallback, including the nested clamp_int
|
|
# default that guards a malformed value.
|
|
for key, fallback in re.findall(r'read_setting\s+"?([A-Za-z]+)"?\s+(?:\\\n\s*)?"?([\w.]+)"?', idle):
|
|
expected = schema_default(key)
|
|
if expected is None:
|
|
failures.append(f"{key}: generator reads a key the schema does not declare")
|
|
elif fallback != expected:
|
|
failures.append(f"{key}: generator falls back to {fallback}, schema default is {expected}")
|
|
|
|
if failures:
|
|
print(f"idle defaults contract: {len(failures)} finding(s)")
|
|
for failure in failures:
|
|
print(f" - {failure}")
|
|
sys.exit(1)
|
|
print("idle defaults contract: ok (generator fallbacks match the schema)")
|
|
PY
|