Skip to content

fix(install): extend locale adaptation to SDDM and hyprlock clocks - #2091

Draft
Delcado19 wants to merge 3 commits into
HyDE-Project:devfrom
Delcado19:fix/locale-sddm-hyprlock-clock
Draft

fix(install): extend locale adaptation to SDDM and hyprlock clocks#2091
Delcado19 wants to merge 3 commits into
HyDE-Project:devfrom
Delcado19:fix/locale-sddm-hyprlock-clock

Conversation

@Delcado19

@Delcado19 Delcado19 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • feat(install): adapt keyboard layout, clock format and keybinds to system locale #2042 adapted the waybar clock's 12h/24h format and date order to the system locale, but left two other clocks with the same hardcoded-English-12h problem: the SDDM greeter theme (Candy/Corners, and any Sddm_* theme bundled with a color theme) hardcodes 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.
  • Also fixes a second, pre-existing bug found while re-verifying feat(install): adapt keyboard layout, clock format and keybinds to system locale #2042: the waybar date-order fix matched only the shipped default's literal %d·%m·%y segment, 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

  • New tests/test_restore_locale_format.sh covering both sed transforms and the order-agnostic date resub, run via tests/run.sh (full suite green apart from the pre-existing, unrelated test_gpuinfo failure)
  • Sandboxed dry-run and real-run against copies of the real hyprlock presets under both a 24h (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-op
  • Applied to a live install: hyprlock screenshot-verified (24h time, no AM/PM, correctly localized weekday) and SDDM greeter visually confirmed correct after a reboot

Summary by CodeRabbit

  • New Features

    • Locale-aware time and date formatting now applies to SDDM greeters and hyprlock lockscreen presets.
    • 12-hour clock presets automatically switch to 24-hour formatting when required by the system locale.
    • Date formatting adapts across different day-month-year orders.
  • Bug Fixes

    • SDDM themes now follow system locale settings without altering unrelated configuration values.
  • Tests

    • Added coverage for locale restoration across hyprlock, SDDM, and waybar.

Delcado19 and others added 2 commits September 13, 2026 11:52
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
@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 65effc6b-b32e-4e0a-a69e-3166fb03a2c8

📥 Commits

Reviewing files that changed from the base of the PR and between d5f23d7 and 9d6532f.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • Configs/.local/lib/hyde/theme.patch.sh
  • Scripts/install_pst.sh
  • Scripts/restore_locale.sh
  • tests/test_restore_locale_format.sh

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The 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.

Changes

Locale formatting

Layer / File(s) Summary
Clock format restoration
Scripts/restore_locale.sh, tests/test_restore_locale_format.sh
Locale format detection runs independently of the Waybar clock file. Date replacement accepts any day-month-year order. Hyprlock presets convert supported 12-hour tokens to %H when the locale uses 24-hour time. Tests cover these transformations and Waybar date orders.
SDDM theme formatting
Configs/.local/lib/hyde/theme.patch.sh, Scripts/install_pst.sh, tests/test_restore_locale_format.sh, CHANGELOG.md
SDDM installation paths blank HourFormat and DateFormat in theme.conf when present. Tests preserve Locale and the changelog records the formatting changes.

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
Loading

Merge Risk: ⚪ Minimal · up to 9d653

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: extending locale adaptation to SDDM and hyprlock clocks.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

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)
  • Create PR with unit tests

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.

❤️ Share

A rabbit reads each line,
The patch grows clear beneath the moon,
Small changes hop in place,
Tests guard the garden path,
Reviews bloom before the dawn.

Comment @coderabbitai help to get the list of available commands.

@kRHYME7
kRHYME7 marked this pull request as draft September 13, 2026 11:18
@kRHYME7

kRHYME7 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

can we do multi file for sddm ? I am not comfortable with sed in this situation.

@kRHYME7

kRHYME7 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

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.

@Delcado19

Copy link
Copy Markdown
Contributor Author

Fair, sed -i on the extracted vendor file wasn't a great look. Rather than mutating it in place, I'll ship a HyDE-maintained theme.conf per bundled theme (Candy/Corners) with HourFormat/DateFormat already blank, and have install_pst.sh/theme.patch.sh copy that in after extraction instead of sed-patching the vendor one — same effect, but the intended file content is fully visible in the PR diff instead of a transformation.

Fully moving SDDM theme delivery onto deez/sddm-themes (so it's a normal dot like everything else) sounds right longer-term, but that's a bigger migration than this locale fix — happy to scope that separately if you want to go there.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants