fix(desktop): make calc a tab-reachable mode again (task 0024)

rofi-calc shows its result in rofi's message widget, not a list entry,
so a tab-reachable calc mode renders it while a calc folded into
combi-modi does not (combi stays the active mode and drops the
sub-mode's message). List calc in modi and drop the dedicated key.
This commit is contained in:
2026-07-22 16:16:50 -04:00
parent af5922b681
commit 6149fd8fa6
2 changed files with 10 additions and 11 deletions

View File

@@ -23,11 +23,12 @@ Structure it so it is reusable as the dmenu-style frontend for later utility men
- `rofi-wayland` no longer exists as a separate package: nixpkgs merged the Wayland fork into `pkgs.rofi` (now 2.0.0), and `rofi-emoji-wayland` into `rofi-emoji`. - `rofi-wayland` no longer exists as a separate package: nixpkgs merged the Wayland fork into `pkgs.rofi` (now 2.0.0), and `rofi-emoji-wayland` into `rofi-emoji`.
The module uses the plain `pkgs.rofi`, which is the Wayland-capable build. The module uses the plain `pkgs.rofi`, which is the Wayland-capable build.
- The combined prompt is rofi's `combi` mode: `combi-modi = "drun,run,window"` merges the run/switch modes into one list, with emoji (via `rofi-emoji`) the one further mode the same window tabs to. - The combined prompt is rofi's `combi` mode: `combi-modi = "drun,run,window"` merges the run/switch modes into one list, and `modi = "combi,calc,emoji"` adds calc (via the `rofi-calc` plugin) and emoji (via `rofi-emoji`) as the two further modes the same window tabs to.
`Super+R` runs `rofi -show combi`. `Super+R` runs `rofi -show combi`.
- Math evaluation is a separate `Super+C` invocation, `rofi -show calc -modi calc -no-show-match -no-sort` (the `rofi-calc` plugin). - calc is a tab-reachable mode, not a member of `combi-modi`.
rofi-calc's live result is one generated entry that only survives with `-no-show-match`, a global rofi flag. rofi-calc returns its result from the mode's message widget (`_get_message`), not as a list entry.
Inside `combi` that flag would also unfilter the `drun`/`run`/`window` app search, so calc cannot share the combi prompt and takes its own key. Tabbing to the calc mode makes it active, so that widget shows the result; folding calc into `combi-modi` keeps `combi` the active mode, whose message does not carry a sub-mode's result, which is why the result was invisible in the merged list.
The Stylix rofi theme styles the `message`/`textbox` widgets and does not hide them, so the result renders without any local theme override.
- The dmenu-style reuse is the themed rofi itself, not a separate abstraction: any `rofi -dmenu` invocation reads the same config and Stylix theme, so the power menu — and later clipboard/utility menus — look uniform for free. - The dmenu-style reuse is the themed rofi itself, not a separate abstraction: any `rofi -dmenu` invocation reads the same config and Stylix theme, so the power menu — and later clipboard/utility menus — look uniform for free.
- The launcher and power-menu keybinds live in this module rather than in `hyprland.nix`, contributed through `settings.bind`, which the module system concatenates with the compositor's own binds in the single `hyprland.conf`. - The launcher and power-menu keybinds live in this module rather than in `hyprland.nix`, contributed through `settings.bind`, which the module system concatenates with the compositor's own binds in the single `hyprland.conf`.
This keeps each command next to its binding and referenced by store path, so a rename cannot silently break the bind. This keeps each command next to its binding and referenced by store path, so a rename cannot silently break the bind.

View File

@@ -42,22 +42,20 @@ in
package = rofiPkg; package = rofiPkg;
# drun, run and window share one prompt through combi. # drun, run and window share one prompt through combi.
# emoji is the separate mode the same window tabs to. # calc and emoji are separate modes the window tabs to.
# calc stays out of combi-modi because its result shows in rofi's
# message widget, which a merged combi list does not surface.
extraConfig = { extraConfig = {
modi = "combi,emoji"; modi = "combi,calc,emoji";
combi-modi = "drun,run,window"; combi-modi = "drun,run,window";
show-icons = true; show-icons = true;
}; };
}; };
# The launcher, a calculator and the session menu, each next to its tool. # The launcher and the session menu, kept next to the tool they drive.
# calc runs on its own key, not in combi.
# Its live result needs rofi's global -no-show-match flag, which would
# unfilter the combi prompt's own app search.
# $mod is defined by the compositor config these binds share. # $mod is defined by the compositor config these binds share.
wayland.windowManager.hyprland.settings.bind = [ wayland.windowManager.hyprland.settings.bind = [
"$mod, R, exec, ${rofiPkg}/bin/rofi -show combi" "$mod, R, exec, ${rofiPkg}/bin/rofi -show combi"
"$mod, C, exec, ${rofiPkg}/bin/rofi -show calc -modi calc -no-show-match -no-sort"
"$mod SHIFT, X, exec, ${powerMenu}" "$mod SHIFT, X, exec, ${powerMenu}"
]; ];
}; };