yazi file picker
This commit is contained in:
@@ -10,7 +10,27 @@
|
||||
package = inputs.yazi.packages.${hyper.system}.default;
|
||||
enableFishIntegration = true;
|
||||
shellWrapperName = "ya";
|
||||
# plugins = with inputs.yazi-plugins.packages.${hyper.system}; { };
|
||||
initLua = /* lua */ ''
|
||||
require("zoxide"):setup {
|
||||
update_db = true,
|
||||
}
|
||||
Status:children_add(function()
|
||||
local h = cx.active.current.hovered
|
||||
if not h or ya.target_family() ~= "unix" then
|
||||
return ""
|
||||
end
|
||||
|
||||
return ui.Line {
|
||||
ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)):fg("magenta"),
|
||||
":",
|
||||
ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)):fg("magenta"),
|
||||
" ",
|
||||
}
|
||||
end, 500, Status.RIGHT)
|
||||
'';
|
||||
plugins = with pkgs; {
|
||||
inherit glow git;
|
||||
};
|
||||
# initLua = /* lua */ '' '';
|
||||
keymap = {
|
||||
mgr.keymap = [
|
||||
@@ -69,6 +89,8 @@
|
||||
{ on = "O"; run = "open --interactive"; desc = "Open selected files interactively"; }
|
||||
{ on = "<Enter>"; run = "open"; desc = "Open selected files"; }
|
||||
{ on = "<S-Enter>"; run = "open --interactive"; desc = "Open selected files interactively"; }
|
||||
{ on = "y"; run = [ ''shell -- for path in "$@"; do echo "file://$path"; done | wl-copy -t text/uri-list''
|
||||
"yank" ]; desc = "Yank selected files (copy)"; }
|
||||
{ on = "y"; run = "yank"; desc = "Yank selected files (copy)"; }
|
||||
{ on = "x"; run = "yank --cut"; desc = "Yank selected files (cut)"; }
|
||||
{ on = "p"; run = "paste"; desc = "Paste yanked "; }
|
||||
@@ -373,4 +395,26 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
xdg = {
|
||||
configFile."xdg-desktop-portal-termfilechooser/config".text = lib.mkIf config.programs.yazi.enable ''
|
||||
[filechooser]
|
||||
cmd=${pkgs.xdg-desktop-portal-termfilechooser}/share/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh
|
||||
env=TERMCMD=ghostty --title="terminal-file-picker -e"
|
||||
default_dir=$HOME
|
||||
open_mode=suggested
|
||||
save_mode=last
|
||||
'';
|
||||
portal = {
|
||||
enable = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-termfilechooser ];
|
||||
config = {
|
||||
common = {
|
||||
"org.freedesktop.impl.portal.FileChooser" = "termfilechooser";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
home.sessionVariables = {
|
||||
GTK_USE_PORTAL = "1";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user