f345fef540
Configure xdg-desktop-portal-termfilechooser to use yazi (via ghostty) for file selection dialogs in portal-aware apps like Firefox. Includes a wrapper script and Hyprland window rules.
33 lines
704 B
Nix
33 lines
704 B
Nix
{
|
|
pkgs,
|
|
myConfig,
|
|
...
|
|
}: let
|
|
yazi-file-picker = pkgs.writeShellScriptBin "yazi-file-picker" ''
|
|
path="$1"
|
|
# multiple="$2"
|
|
# directory="$3"
|
|
${pkgs.yazi}/bin/yazi --chooser-file="$path"
|
|
'';
|
|
in {
|
|
programs.yazi = {
|
|
enable = true;
|
|
enableFishIntegration = true;
|
|
settings = {
|
|
manager = {
|
|
show_hidden = true;
|
|
sort_by = "natural";
|
|
sort_dir_first = true;
|
|
linemode = "size";
|
|
};
|
|
};
|
|
};
|
|
|
|
home.packages = [yazi-file-picker];
|
|
|
|
xdg.configFile."xdg-desktop-portal-termfilechooser/config".text = ''
|
|
[filechooser]
|
|
cmd=${pkgs.ghostty}/bin/ghostty --class=yazi-file-picker -e ${yazi-file-picker}/bin/yazi-file-picker
|
|
'';
|
|
}
|