fix(rofi): resolve whole-swap launcher @import and page the app grid

The Apps launcher (`rofi -show drun -theme launcher`) imported
`custom.rasi` — the name HM gives *generated* themes — but a whole-swap
theme's base is deployed under its source basename (`rofi.rasi`), so the
import resolved against $HOME and rofi errored with "custom.rasi not
found" on every whole-swap theme. Make the default import track the
active base (rofi.rasi for whole-swaps, custom.rasi otherwise) and point
Boreal's own launcher.rasi at rofi.rasi.

Also give Boreal's app grid `flow: horizontal` so Down at a column's foot
pages to the next screen instead of jumping to the next column's top,
mirroring the theme-picker grid.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-07 17:36:01 +01:00
parent 175b877f95
commit ddf9b186e4
2 changed files with 18 additions and 8 deletions

View File

@@ -23,8 +23,9 @@ let
# Kept separate from the base theme so a theme can give the launcher its
# own layout (e.g. Boreal's icon grid) WITHOUT that layout leaking into
# the text menus, which share the base theme and need a list. The default
# just re-imports the active theme (custom.rasi, written by HM to the same
# themes dir), so every other theme's launcher is byte-for-byte its list.
# just re-imports the active base theme (custom.rasi for generated themes,
# rofi.rasi for whole-swaps — see the dataFile below), so every other
# theme's launcher is byte-for-byte its list.
launcherOverride = cfg.themesDir + "/${t.slug}/launcher.rasi";
hasLauncherOverride = builtins.pathExists launcherOverride;
@@ -855,13 +856,17 @@ in
'';
};
# The launcher theme lives beside HM's generated theme
# (~/.local/share/rofi/themes/custom.rasi), so `@import "custom.rasi"`
# in the default resolves to the active theme.
# The launcher theme lives beside HM's active base theme, which it
# @imports so the default launcher is byte-for-byte that theme's list.
# HM names that base by its SOURCE: a generated (attrset) theme lands as
# custom.rasi, but a whole-swap theme (a path — themes/<slug>/rofi.rasi)
# keeps its basename, rofi.rasi. Import must match, or `-theme launcher`
# dies with "custom.rasi not found" (rofi resolves the missing import
# against $HOME) on every whole-swap theme.
xdg.dataFile."rofi/themes/launcher.rasi".text =
if hasLauncherOverride
then builtins.readFile launcherOverride
else ''@import "custom.rasi"'';
else ''@import "${if hasRasiOverride then "rofi.rasi" else "custom.rasi"}"'';
programs.rofi = {
enable = true;

View File

@@ -2,12 +2,13 @@
* Boreal — app-launcher override (themes/<slug>/launcher.rasi).
* Installed to ~/.local/share/rofi/themes/launcher.rasi and used only by
* `rofi -show drun` (the SUPER+Space / SUPER+D launcher). It inherits the
* frosted aurora panel from the sibling custom.rasi (the active theme),
* frosted aurora panel from the sibling rofi.rasi (this whole-swap theme,
* which HM deploys under its source basename — rofi.rasi — not custom.rasi),
* then reshapes the list into a 4×3 grid of large application icons.
* Text menus keep the list — they don't use this theme.
*/
@import "custom.rasi"
@import "rofi.rasi"
window { width: 780px; }
@@ -17,6 +18,10 @@ listview {
fixed-columns: true;
spacing: 10px;
padding: 6px 0px 0px 0px;
/* Fill row-by-row so Down at a column's foot pages to the next screen
instead of jumping to the top of the next column (rofi's default
Vertical flow). Mirrors the theme-picker grid in rofi.nix. */
flow: horizontal;
}
element {