Skip to content

Notch theme switcher + keybind for the wallpapers tab - #88

Merged
gitcoder89431 merged 2 commits into
gitcoder89431:masterfrom
Palccod:notch-theme-switcher
Sep 29, 2026
Merged

gitcoder89431 merged 2 commits into
gitcoder89431:masterfrom
Palccod:notch-theme-switcher

Conversation

@Palccod

@Palccod Palccod commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

What

Two additions to the notch's Wallpapers tab, built as one feature:

A keybind for the tab. New ruixen.notch toggleWallpapers IPC — same shape as toggleDashboard (a closed notch opens straight onto the Wallpapers tab, an open one just closes). The recommended keybind is SUPER + CTRL + SPACE; note that key is stock Omarchy's Background switcher, so install.sh keeps its existing "key already bound — leaving it untouched" behavior and prints the collision for manual unbind-first setup. docs/KEYBINDS.md shows the hl.unbind + o.bind pair.

A theme switcher in the tab. A WALLPAPER SWITCHER / THEME SWITCHER segmented control above the search box (direct request: "the 2 options will be above the search box, so theme will say search themes..."). Theme mode lists every installed Omarchy theme with real preview tiles and clicking one runs the real omarchy-theme-set — the same front door as Omarchy's own theme menu, after stopping any playing video/GIF with a fresh generation. The search placeholder follows the mode ("Search themes..." / "Search wallpapers..."); switching modes clears the shared search box.

How

  • Theme discovery lives in a new shipped bars/widgets/ruixen.notch/list-themes.sh — same extraction-so-tests-cannot-drift rationale as list-wallpapers.sh ([P2] Extract wallpaper discovery into shared production code so tests cannot drift #17). It replicates omarchy-theme-switcher's own preview rules (read directly, not guessed): preview.{png,jpg,jpeg,webp,gif,bmp} at the theme's top level, else the first sorted backgrounds/ image, else fall back to the same-name system theme. User themes (dirs or symlinks) union system themes (dirs), user copy winning — the same two-source resolution omarchy-theme-set itself accepts.
  • Grid fill: the theme grid sizes itself to the panel — as many ≥170px-minimum columns as fit, cells stretched to consume the row (tiles grow 160→180px, same 10px gap rhythm as the wallpaper side), with the indivisible remainder centered so left/right margins are equal instead of a dead strip on the right (direct request). Preview sourceSize tracks the rendered tile so larger tiles stay sharp. The launcher's own wallpaper card is deliberately unchanged — the keybind targets the notch tab, and that copy stays a pure picker (its sync comment says so now).
  • Safety: applyTheme whitelist-validates the theme name against ^[A-Za-z0-9][A-Za-z0-9_-]*$ before it reaches a fixed-argv Process; labels render Text.PlainText; theme names come from directory basenames that omarchy-theme-set re-normalizes itself.

Tests

New tests/notch-theme-switcher.sh (26 checks, registered in run-all.sh): runs the real list-themes.sh against a fixture tree (preview.png, backgrounds-only, user-falls-back-to-system, user-over-system precedence, dot-dir skip, title-casing) and grep-pins the QML/IPC/installer wiring (segmented control placement above the search box, placeholder swap, whitelist + omarchy-theme-set routing, stop-with-fresh-generation, toggleWallpapers, keybind recommendation + dry-run preview). Full run-all.sh green.

Live-verified on a real omarchy restart shell: keybind registered (omarchy menu keybindings shows SUPER CTRL + SPACE → Ruixen wallpapers), toggle IPC opens the tab, theme grid renders all 25 installed themes with previews, and the apply path was exercised end-to-end against a stubbed omarchy-theme-set on PATH (optimistic CURRENT highlight, then re-synced from theme.name after the post-set refresh) — real themes untouched.

Palccod and others added 2 commits September 29, 2026 02:09
The notch's Wallpapers tab gains a WALLPAPER SWITCHER / THEME SWITCHER
segmented control above its search box (direct request: "the 2 options
will be above the search box, so theme will say search themes...").
Theme mode lists every installed Omarchy theme -- discovered by a new
shipped list-themes.sh (same extraction-so-tests-cannot-drift pattern
as list-wallpapers.sh) -- with omarchy-theme-switcher's own preview
rules, and clicking a tile runs the real omarchy-theme-set, stopping
any playing video/gif first with a fresh generation. The search
placeholder follows the mode; switching modes clears the shared search
box. Notch-only by design: the launcher's wallpaper card stays a pure
picker (its sync comment says so now).

New ruixen.notch toggleWallpapers IPC (same shape as toggleDashboard)
backed by the SUPER+ALT+W recommended keybind, added to install.sh's
--with-launcher-keybind set (the key was verified free of Omarchy
defaults; SUPER+W and SUPER+SHIFT+W are taken).

Guarded by tests/notch-theme-switcher.sh, which runs the real
list-themes.sh against a fixture tree (preview.png, backgrounds-only,
user-falls-back-to-system, user-over-system precedence, dot-dir skip)
and pins the QML/IPC/installer wiring; registered in run-all.sh.
Collapses the WALLPAPER/THEME segmented control and search box into a
single row, styled as one sliding tab pill on the right of the search
field instead of two separate always-bordered chips. Also fixes two
real bugs in the theme grid's own column math: the width formula could
undercount how many columns GridView actually renders per row, and the
tile-width formula was subtracting an extra, unearned gap on top of the
correct one -- both are corrected so the grid now reliably renders the
right column count at the widest tile size the row allows. Adds a
magnify glyph in front of the search placeholder, matching the same
icon ruixen.settings' own search box already uses.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@gitcoder89431
gitcoder89431 merged commit 4182898 into gitcoder89431:master Sep 29, 2026
1 check passed
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