feat: meep

This commit is contained in:
Kat Inskip 2025-11-24 22:12:05 -08:00
parent 779c3c4098
commit 4477a98282
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
5 changed files with 114 additions and 30 deletions

View file

@ -0,0 +1,42 @@
{
config,
lib,
...
}: let
cfg = config.programs.anyrun;
inherit (lib.meta) getExe;
in {
programs.niri.settings.binds = {
"Mod+D".action = let
sh = config.lib.niri.actions.spawn "sh" "-c";
in
sh (getExe cfg.package);
};
programs.anyrun = {
enable = true;
config = {
x = {fraction = 0.5;};
y = {fraction = 0.3;};
width = {fraction = 0.3;};
hideIcons = false;
ignoreExclusiveZones = false;
layer = "overlay";
hidePluginInfo = false;
closeOnClick = false;
showResultsImmediately = true;
maxEntries = null;
plugins = let
pluginNames = [
"applications"
"symbols"
"niri_focus"
"dictionary"
"rink"
"nix_run"
];
pluginLibs = map (p: "${cfg.package}/lib/lib${p}.so") pluginNames;
in
pluginLibs;
};
};
}

View file

@ -5,6 +5,9 @@
inputs,
...
}: let
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) attrs package;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.meta) getExe getExe';
inherit (inputs.fzfdapter.packages.${pkgs.system}) fzfdapter;
terminal_exec = args: "${getExe pkgs.alacritty}${
@ -12,39 +15,59 @@
then " ${args} "
else " "
}-e";
cfg = config.programs.fzfdapter;
in {
home.packages = [
fzfdapter
pkgs.skim
];
xdg.configFile."fzfdapter/config.toml".source = (pkgs.formats.toml {}).generate "fzfdapter-config" {
terminal_exec = terminal_exec "";
fuzzy_exec = "${getExe' pkgs.skim "sk"} --layout=reverse-list";
};
# TODO: `niri msg focused-output` to handle resolution(s)
programs.niri.settings = let
sh = config.lib.niri.actions.spawn "sh" "-c";
in {
binds = {
"Mod+D".action = sh "${terminal_exec "-T fzfdapter --option 'font.size=18' --class fzfdapter"} ${getExe fzfdapter} --mode all";
options.programs.fzfdapter = {
enable = mkEnableOption "Enable fzfdapter";
settings = mkOption {
type = attrs;
};
window-rules = [
{
matches = [
package = mkOption {
type = package;
default = fzfdapter;
};
};
config = mkMerge [
(mkIf cfg.enable {
home.packages = [
cfg.package
];
xdg.configFile."fzfdapter/config.toml".source = (pkgs.formats.toml {}).generate "fzfdapter-config" cfg.settings;
})
{
home.packages = [
pkgs.skim
];
programs.fzfdapter = {
enable = false;
settings = {
terminal_exec = terminal_exec "";
fuzzy_exec = "${getExe' pkgs.skim "sk"} --layout=reverse-list";
};
};
# TODO: `niri msg focused-output` to handle resolution(s)
programs.niri.settings = {
binds = {
#"Mod+D".action = sh "${terminal_exec "-T fzfdapter --option 'font.size=18' --class fzfdapter"} ${getExe fzfdapter} --mode all";
};
window-rules = [
{
app-id = "^fzfdapter$";
title = "fzfdapter";
matches = [
{
app-id = "^fzfdapter$";
title = "fzfdapter";
}
];
max-height = 1000;
max-width = 750;
min-height = 1000;
min-width = 750;
open-focused = true;
open-floating = true;
}
];
max-height = 1000;
max-width = 750;
min-height = 1000;
min-width = 750;
open-focused = true;
open-floating = true;
}
];
};
};
}
];
}

View file

@ -9,6 +9,7 @@
in {
programs.nixvim = {
enable = true;
defaultEditor = true;
imports = [
tree.home.profiles.nixvim.plugins
];
@ -87,6 +88,8 @@ in {
(genAttrs pluginsToGen (_: basePlugin))
{
auto-session.settings = {
auto_save = true;
auto_create = true;
bypass_save_filetypes = ["startup"];
close_filetypes_on_save = ["startup"];
};