{pkgs, ...}: {
  home.packages = [pkgs.xplr];
  xdg.configFile."xplr/init.lua".text = ''
    version = '0.20.2';

    local home = os.getenv("HOME");
    package.path = home
      .. "/.config/xplr/plugins/?/init.lua;"
      .. home
      .. "/.config/xplr/plugins/?.lua;"
      .. package.path;

    require("icons").setup();
    require("extra-icons").setup();
    require("zoxide").setup();

    xplr.config.modes.builtin.default.key_bindings.on_key.R = {
      help = "batch rename",
      messages = {
        {
          BashExec = [===[
            SELECTION=$(cat "''${XPLR_PIPE_SELECTION_OUT:?}")
            NODES=''${SELECTION:-$(cat "''${XPLR_PIPE_DIRECTORY_NODES_OUT:?}")}
            if [ "$NODES" ]; then
              echo -e "$NODES" | "${pkgs.pipe-rename}/bin/renamer"
              "$XPLR" -m ExplorePwdAsync
            fi
          ]===],
        },
      },
    };
  '';
}