diff --git a/home/programs/default.nix b/home/programs/default.nix index 4aa5513..4c2a764 100644 --- a/home/programs/default.nix +++ b/home/programs/default.nix @@ -15,10 +15,6 @@ programs = { fzf.enable = true; hyfetch.enable = true; - yazi = { - enable = true; - enableFishIntegration = true; - }; }; # miscellaneous programs that do not need to be configured diff --git a/home/programs/niri/binds.nix b/home/programs/niri/binds.nix index 7b5bbb6..aa190a9 100644 --- a/home/programs/niri/binds.nix +++ b/home/programs/niri/binds.nix @@ -9,14 +9,14 @@ browser = "firefox"; prefix = "Alt"; guiFileManager = "nautilus"; - cliFileManager = "${terminal} -e yazi"; + cliFileManager = "yazi"; in { programs.niri.settings.binds = { "${prefix}+D".action.spawn = appLauncher; "${prefix}+Return".action.spawn = terminal; "${prefix}+W".action.spawn = browser; "${prefix}+E".action.spawn = guiFileManager; - "${prefix}+Shift+E".action.spawn = cliFileManager; + "${prefix}+Shift+E".action.spawn = [terminal "-e" cliFileManager]; "${prefix}+Shift+Slash".action = config.lib.niri.actions.show-hotkey-overlay; "${prefix}+Q".action = config.lib.niri.actions.close-window; diff --git a/home/terminal/programs/default.nix b/home/terminal/programs/default.nix index 9a6ec9c..01cc605 100644 --- a/home/terminal/programs/default.nix +++ b/home/terminal/programs/default.nix @@ -4,8 +4,8 @@ ./gnupg.nix ./tmux.nix ./direnv.nix - ./zellij.nix ./nix-index.nix + ./yazi.nix ]; home.packages = with pkgs; [ diff --git a/home/terminal/programs/yazi.nix b/home/terminal/programs/yazi.nix new file mode 100644 index 0000000..e439e7f --- /dev/null +++ b/home/terminal/programs/yazi.nix @@ -0,0 +1,26 @@ +{pkgs, ...}: { + programs.yazi = let + # https://github.com/iynaix/dotfiles/blob/8bb1568019ea26f034ac1af9c499b3ff102391a5/home-manager/shell/yazi.nix#L9-L11 + mkYaziPlugin = name: text: { + "${name}" = toString (pkgs.writeTextDir "${name}.yazi/init.lua" text) + "/${name}.yazi"; + }; + in { + enable = true; + enableFishIntegration = true; + plugins = mkYaziPlugin "smart-enter" '' + return { + entry = function() + local h = cx.active.current.hovered + ya.manager_emit(h and h.cha.is_dir and "enter" or "open", { hovered = true }) + end, + } + ''; + keymap.manager.prepend_keymap = [ + { + on = "l"; + run = "plugin --sync smart-enter"; + desc = "Enter the child directory, or open the file"; + } + ]; + }; +} diff --git a/home/terminal/programs/zellij.nix b/home/terminal/programs/zellij.nix deleted file mode 100644 index c2199c3..0000000 --- a/home/terminal/programs/zellij.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - programs.zellij = { - enable = true; - settings = { - pane_frames = false; - }; - }; -}