Skip to content

feat(rice-switch): frosted menu theme of its own - #77

Merged
Schnee111 merged 1 commit into
mainfrom
feat/issue-75-rice-switch-theme
Oct 25, 2026
Merged

Schnee111 merged 1 commit into
mainfrom
feat/issue-75-rice-switch-theme

Conversation

@Schnee111

Copy link
Copy Markdown
Owner

Fixes #75

What this fixes

The rice switcher reused display.rasi, the display-mode switcher's theme:

  • 3 of 8 rices visible (lines: 3);
  • entries cut off at 380 px, so [ACTIVE] never showed;
  • a "Select display mode..." placeholder;
  • a 92 % opaque box instead of glass;
  • a different emoji on every row.

Approach

New common/rofi/rice-switch.rasi, a frosted panel in the style of macOS Spotlight:

  • the panel is rgba(28, 28, 32, 70%) with a 1 px rgba(255, 255, 255, 13%) border, 18 px radius and 520 px width. That is translucent enough for the existing rofi blur layer rule on end4 and ii-p3drovfx, and still readable on rices without one;
  • a large Inter Display 15 search field with a magnifier glyph and a "Switch rice" placeholder, separated by a hairline;
  • two-line rows: the name in semibold, then compositor · shell at 55 % alpha. The hover/selection state is a soft rgba(255, 255, 255, 10%) pill;
  • only the accent comes from the palette (@selected-fg from colors.rasi). It marks the current rice;
  • a footer: Current: end4 · ↵ switch and log out · esc cancel.

bin/rice-switch gui_menu:

  • Rows are built from DISPLAY_NAME: the leading glyph is dropped, and the part in parentheses becomes the subtitle. Text is escaped for Pango. Rows are separated by \x1f (-sep, -eh 2).
  • -l <count> shows every rice.
  • -a and -selected-row mark and preselect the current rice, so an accidental Enter only reports "already active".
  • -no-custom -format i: rofi returns the row index, and fuzzel does the same with --index. The choice is no longer matched by display text, and an index out of range is ignored.
  • Theme lookup: rice-switch.rasi, then display.rasi until the next install links the new file (lib/common.sh).
  • display.rasi and the display switchers are unchanged.

tests/rice-switch.sh: the stub rofi records its stdin and arguments. New checks:

  • one row per rice;
  • a plain title and a subtitle, with no glyph;
  • the current rice is passed to -a;
  • an out-of-range index does not switch;
  • the fallback to display.rasi works.

Verification

  • bash tests/run.sh: all test files pass. shellcheck -S warning is clean; the pre-existing SC2015 info in status is unchanged.
  • Live on end4 (1920x1080), using the real ~/.local/bin/rice-switch -n with the theme linked. Screenshots were checked by hand:
    • all 8 rices are visible with nothing cut off;
    • the panel blurs the windows behind it;
    • the current rice (end4) is in the accent colour and preselected;
    • Down moves the selection pill;
    • Escape closes the menu, and the script exits 0 with no output.
  • Not checked live: the fuzzel path. fuzzel 1.14.0 is installed here and documents --index, but this host takes the rofi path.

Risk

Low. Visual only, apart from the index-based choice, which the tests cover. On rices without a blur rule for the rofi layer, the panel is a 70 % dark translucent box.

The switcher reused display.rasi, so it showed 3 of 8 rices, cut every
entry off at 380px, said "Select display mode..." and was a 92% opaque
box. Give it common/rofi/rice-switch.rasi: a translucent blurred panel
with a thin border, every rice visible, name and compositor/shell as a
two-line row without the DISPLAY_NAME glyph, the current rice marked
active and preselected, and a footer hint. Both menus now return the
row index, so the shown text no longer has to match DISPLAY_NAME.
display.rasi is unchanged and stays the fallback until install links
the new theme.

Fixes #75
Copilot AI balanced review requested due to automatic review settings October 25, 2026 00:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@Schnee111 Schnee111 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Autonomous Code Review

Verdict: Approved
Target Commit: e2f9eb3

Summary

Introduces a dedicated frosted macOS Spotlight-style Rofi theme for rice-switching with index-based selection and Pango markup escaping. Fallback handling to display.rasi and comprehensive regression tests ensure robust backward compatibility.


Shorekeeper Sentinel · Autonomous Quality Gate

@Schnee111
Schnee111 merged commit c92a64b into main Oct 25, 2026
1 check passed
@Schnee111
Schnee111 deleted the feat/issue-75-rice-switch-theme branch October 25, 2026 00:38
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.

rice-switch: menu theme cuts off entries, shows 3 of 8 rices and is not frosted

2 participants