From af5922b681651cb2b1ebf53984f4a36ea49a4992 Mon Sep 17 00:00:00 2001 From: alexion Date: Wed, 22 Jul 2026 16:10:10 -0400 Subject: [PATCH] fix(desktop): give calc its own key instead of combi (task 0024) rofi-calc's live result only shows with the global -no-show-match flag, which inside combi would unfilter the drun/run/window app search. Move math evaluation to its own Super+C invocation carrying that flag, and return combi to drun,run,window with emoji as the tab-away mode. --- .claude/tasks/0024-rofi-launcher.md | 6 ++++-- modules/desktop/rofi.nix | 10 +++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.claude/tasks/0024-rofi-launcher.md b/.claude/tasks/0024-rofi-launcher.md index 3189b8d..89a53a4 100644 --- a/.claude/tasks/0024-rofi-launcher.md +++ b/.claude/tasks/0024-rofi-launcher.md @@ -23,9 +23,11 @@ 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`. 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,calc"` merges the run/switch modes and calc (via the `rofi-calc` plugin) into one list, so math results appear inline in the same view. - `modi = "combi,emoji"` leaves emoji (via `rofi-emoji`) as 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, with emoji (via `rofi-emoji`) the one further mode the same window tabs to. `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). + rofi-calc's live result is one generated entry that only survives with `-no-show-match`, a global rofi flag. + 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. - 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`. This keeps each command next to its binding and referenced by store path, so a rename cannot silently break the bind. diff --git a/modules/desktop/rofi.nix b/modules/desktop/rofi.nix index e15f44a..2f2b7ec 100644 --- a/modules/desktop/rofi.nix +++ b/modules/desktop/rofi.nix @@ -41,19 +41,23 @@ in enable = true; package = rofiPkg; - # drun, run, window and calc share one prompt through combi. + # drun, run and window share one prompt through combi. # emoji is the separate mode the same window tabs to. extraConfig = { modi = "combi,emoji"; - combi-modi = "drun,run,window,calc"; + combi-modi = "drun,run,window"; show-icons = true; }; }; - # The launcher and the session menu, kept next to the tool they drive. + # The launcher, a calculator and the session menu, each next to its tool. + # 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. wayland.windowManager.hyprland.settings.bind = [ "$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}" ]; };