fix(install): extend locale adaptation to SDDM and hyprlock clocks - #2091
fix(install): extend locale adaptation to SDDM and hyprlock clocks#2091Delcado19 wants to merge 3 commits into
Conversation
HyDE-Project#2042 made restore_locale.sh adapt the waybar clock's 12h/24h format and date order to the system locale, but left two other clocks with the same problem untouched: the SDDM greeter theme (Candy/Corners and any Sddm_* theme bundled with a color theme) hardcodes English 12h HourFormat/ DateFormat in its theme.conf, and every hyprlock preset hardcodes a 12h `date` format string. restore_locale.sh now switches hyprlock's preset clocks to 24h alongside the waybar clock, reusing the already-computed 12h/24h decision. SDDM's HourFormat/DateFormat are blanked once, at theme-extraction time in install_pst.sh and theme.patch.sh, so Qt's own locale-aware Locale.ShortFormat/LongFormat takes over instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X1SjbyvkBXwHm4ZprDQc93
…alue restore_locale.sh's date-order fix only ever matched the shipped default's literal "%d·%m·%y" segment. Once a run under a different locale rewrote it to another order, that literal was gone, so every later run silently stopped correcting the date order even under the right locale again. Found while re-verifying HyDE-Project#2042's clock-format fix after extending it to hyprlock and SDDM: a stray test run under LC_TIME=en_US.UTF-8 against a live waybar config left it stuck in month-day-year order. Match any %[dmy]·%[dmy]·%[dmy] segment instead of one fixed literal, so the fix is self-correcting on every run no matter what order it's currently in. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X1SjbyvkBXwHm4ZprDQc93
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueNo actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change extends locale-aware formatting to hyprlock presets and SDDM themes. Locale date detection now supports repeated updates. Tests cover hyprlock, SDDM, and Waybar formatting behavior. ChangesLocale formatting
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant restore_locale.sh
participant LC_TIME
participant hyprlock presets
restore_locale.sh->>LC_TIME: Read locale time and date formats
LC_TIME-->>restore_locale.sh: Return t_fmt and d_fmt
restore_locale.sh->>hyprlock presets: Convert 12-hour tokens when %H is detected
Merge Risk: ⚪ Minimal · up to Locale formatting changes are limited to their intended installation and restoration paths, with no unresolved merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit reads each line, Comment |
|
can we do multi file for sddm ? I am not comfortable with sed in this situation. |
|
https://github.com/HyDE-Project/sddm-themes example we can use deez-dots for sddm install the theme and after that use deez too to patch a theme like we keep 2 file if sddm .conf file do not permit multi config file. |
|
Fair, Fully moving SDDM theme delivery onto deez/ |
dev moved tests/ to a git submodule (HyDE-Project/tests) while this PR was open, so a plain file under this path conflicts with the gitlink on merge. Dropping the new test file here; the code fix and CHANGELOG entry stand on their own. Coverage moves to HyDE-Project/tests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X1SjbyvkBXwHm4ZprDQc93
Summary
Sddm_*theme bundled with a color theme) hardcodesHourFormat/DateFormatin itstheme.conf, and every hyprlock preset hardcodes a 12hdateformat string.restore_locale.shnow switches hyprlock's preset clocks to 24h alongside the waybar clock, reusing the already-computed 12h/24h decision. SDDM'sHourFormat/DateFormatare blanked once, at theme-extraction time ininstall_pst.shandtheme.patch.sh, so Qt's own locale-awareLocale.ShortFormat/LongFormattakes over instead.%d·%m·%ysegment, so a single run under a different locale would permanently wedge the date order, with no way for a later run (even under the correct locale) to self-correct. Now matches any%[dmy]·%[dmy]·%[dmy]segment instead of one fixed literal.Test plan
tests/test_restore_locale_format.shcovering both sed transforms and the order-agnostic date resub, run viatests/run.sh(full suite green apart from the pre-existing, unrelatedtest_gpuinfofailure)de_DE) and 12h (en_US) locale, confirming the 24h locale converts every preset and the 12h locale leaves them untouched, and that a second run is a no-opSummary by CodeRabbit
New Features
Bug Fixes
Tests