# Fuzzel — launcher, dmenu renderer for the menu system, themed from # theme-state.json like every other surface. Also home of nomarchy-menu, # the dispatcher script the menu roadmap grows out of (first module: # power). { config, lib, pkgs, ... }: let cfg = config.nomarchy; t = cfg.theme; c = t.colors; # fuzzel.ini colors are rrggbbaa, no leading #. hexa = color: alpha: "${lib.removePrefix "#" color}${alpha}"; nomarchy-menu = pkgs.writeShellScriptBin "nomarchy-menu" '' # Nomarchy menu dispatcher — thin presentation layer over # `fuzzel --dmenu`; actions delegate to systemctl/hyprctl/ # nomarchy-theme-sync. The icons are nf-md glyphs (any shipped # Nerd Font carries them). case "''${1:-}" in power) choice=$(printf '%s\n' \ "󰍃 Logout" \ "󰤄 Suspend" \ "󰒲 Hibernate" \ "󰜉 Reboot" \ "󰐥 Shutdown" \ | fuzzel --dmenu --prompt "power " --lines 5 --width 24) || exit 0 case "$choice" in *Logout) hyprctl dispatch exit ;; *Suspend) systemctl suspend ;; *Hibernate) systemctl hibernate ;; *Reboot) systemctl reboot ;; *Shutdown) systemctl poweroff ;; esac ;; *) echo "usage: nomarchy-menu power" >&2 exit 64 ;; esac ''; in { config = lib.mkIf cfg.fuzzel.enable { home.packages = [ nomarchy-menu ]; programs.fuzzel = { enable = true; settings = { main = { # UI font first; the mono Nerd Font follows so menu icons # (nf-md glyphs) resolve — fcft falls back per glyph. font = "${t.fonts.ui}:size=${toString (t.fonts.size + 1)}, ${t.fonts.mono}:size=${toString (t.fonts.size + 1)}"; terminal = cfg.terminal; layer = "overlay"; lines = 12; width = 40; horizontal-pad = 24; vertical-pad = 16; inner-pad = 8; }; colors = { background = hexa c.base "f2"; text = hexa c.text "ff"; prompt = hexa c.subtext "ff"; placeholder = hexa c.muted "ff"; input = hexa c.text "ff"; match = hexa c.accent "ff"; selection = hexa c.surface "ff"; selection-text = hexa c.text "ff"; selection-match = hexa c.accent "ff"; border = hexa c.accent "ee"; }; border = { width = t.ui.borderSize; radius = t.ui.rounding; }; }; }; }; }