feature(yazi): Add yazi plugins

This commit is contained in:
DashieTM 2025-08-23 17:15:10 +02:00
parent fb2507afe7
commit 28d08a5c8a
4 changed files with 34 additions and 16 deletions

View file

@ -79,6 +79,7 @@ in {
"zen.theme.accent-color" = "#b4bbff";
"extensions.autoDisableScopes" = 0;
"cookiebanners.service.mode" = 2;
"widget.use-xdg-desktop-portal.file-picker" = 1;
};
isDefault = true;
id = 0;
@ -95,6 +96,7 @@ in {
"zen.view.welcome-screen.seen" = true;
"zen.theme.accent-color" = "#b4bbff";
"extensions.autoDisableScopes" = 0;
"widget.use-xdg-desktop-portal.file-picker" = 1;
};
isDefault = false;
id = 1;

View file

@ -193,16 +193,17 @@ in {
) "$mod SUPERSHIFT,F,exec,${browserName} -p special")
"$mod SUPER,T,exec,kitty -1"
"$mod SUPER,E,exec,nautilus -w"
(lib.mkIf config.mods.yazi.enable "$mod SUPER,Y,exec, EDITOR='neovide --no-fork' kitty yazi")
"$mod SUPER,N,exec,neovide"
(lib.mkIf (config.mods.anyrun.enable) "$mod SUPER,R,exec,anyrun")
(lib.mkIf (config.mods.oxi.oxirun.enable) "$mod SUPER,R,exec,oxirun")
(lib.mkIf (config.mods.oxi.oxidash.enable) "$mod SUPER,M,exec,oxidash")
(lib.mkIf (config.mods.oxi.oxicalc.enable) "$mod SUPER,G,exec,oxicalc")
(lib.mkIf (config.mods.oxi.oxishut.enable) "$mod SUPER,D,exec,oxishut")
(lib.mkIf (config.mods.oxi.oxipaste.enable) "$mod SUPER,A,exec,oxipaste")
(lib.mkIf (config.mods.oxi.hyprdock.enable) "$mod SUPERSHIFT,P,exec,hyprdock --gui")
(lib.mkIf (config.mods.hypr.hyprlock.enable) "$mod SUPERSHIFT,L,exec, playerctl -a pause & hyprlock & systemctl suspend")
(lib.mkIf (config.mods.hypr.hyprlock.enable) "$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate")
(lib.mkIf config.mods.anyrun.enable "$mod SUPER,R,exec,anyrun")
(lib.mkIf config.mods.oxi.oxirun.enable "$mod SUPER,R,exec,oxirun")
(lib.mkIf config.mods.oxi.oxidash.enable "$mod SUPER,M,exec,oxidash")
(lib.mkIf config.mods.oxi.oxicalc.enable "$mod SUPER,G,exec,oxicalc")
(lib.mkIf config.mods.oxi.oxishut.enable "$mod SUPER,D,exec,oxishut")
(lib.mkIf config.mods.oxi.oxipaste.enable "$mod SUPER,A,exec,oxipaste")
(lib.mkIf config.mods.oxi.hyprdock.enable "$mod SUPERSHIFT,P,exec,hyprdock --gui")
(lib.mkIf config.mods.hypr.hyprlock.enable "$mod SUPERSHIFT,L,exec, playerctl -a pause & hyprlock & systemctl suspend")
(lib.mkIf config.mods.hypr.hyprlock.enable "$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate")
# media keys
(lib.mkIf config.mods.scripts.audioControl ",XF86AudioMute,exec, audioControl mute")

View file

@ -1,4 +1,5 @@
{
pkgs,
lib,
config,
options,
@ -35,16 +36,26 @@
type = with lib.types; attrsOf anything;
description = "Additional keymap for yazi";
};
plugins = lib.mkOption {
default = {
inherit (pkgs.yaziPlugins) piper diff gitui;
};
example = {};
type = with lib.types; attrsOf anything;
description = "Additional keymap for yazi";
};
};
config = let
conf = import ./yazi.nix;
in
lib.optionalAttrs (options ? home.packages) (
lib.mkIf config.mods.yazi.enable {
home.packages = [pkgs.glow];
programs.yazi = {
enable = conf.enable;
settings = conf.settings // config.mods.yazi.additionalKeymap;
keymap = conf.keymap // config.mods.yazi.additionalConfig;
plugins = config.mods.yazi.plugins;
};
}
);

View file

@ -85,19 +85,23 @@
};
plugin = {
prepend_previewers = [
{
name = "*.tar";
run = ''piper --format=url -- tar tf "$1"'';
}
{
name = "*.md";
run = "glow";
run = ''piper -- CLICOLOR_FORCE=1 glow -w=$w -s=dark "$1"'';
}
{
mime = "text/csv";
run = "miller";
run = ''piper -- bat -p --color=always "$1"'';
}
];
};
};
keymap = {
manager.keymap = [
mgr.keymap = [
{
on = ["<Esc>"];
run = "escape";
@ -368,13 +372,13 @@
desc = "Cancel the ongoing search";
}
{
on = ["z"];
run = "jump zoxide";
on = ["Z"];
run = "plugin zoxide";
desc = "Jump to a directory using zoxide";
}
{
on = ["Z"];
run = "jump fzf";
on = ["z"];
run = "plugin fzf";
desc = "Jump to a directory or reveal a file using fzf";
}