{ config, lib, pkgs, ... }: let cfg = config.kassouni.palette; in { # Wayland front end for the palette. `--index` is fuzzel's answer to rofi's # `-format i`, so the same index-into-exes trick works. Unlike rofi, fuzzel # will happily accept text that matches no row; it exits non-zero there, but # the numeric guard keeps a surprising build of fuzzel from indexing the # array with garbage. home.packages = [ (pkgs.writers.writeBashBin "open-palette-fuzzel" '' set -eu exes=(${lib.concatMapStringsSep " " (c: "${c.exe}") cfg.commands}) idx=$(${pkgs.fuzzel}/bin/fuzzel --dmenu --index --prompt "palette " <