2024-10-21 12:31:30 +07:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2024-06-26 13:25:55 +07:00
|
|
|
let
|
|
|
|
cfg = config.profile.programs.yazi;
|
|
|
|
inherit (lib) mkIf;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
config = mkIf cfg.enable {
|
2024-08-28 19:00:18 +07:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
mediainfo
|
|
|
|
ffmpegthumbnailer
|
|
|
|
];
|
2024-06-26 13:25:55 +07:00
|
|
|
programs.yazi = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
# https://yazi-rs.github.io/docs/configuration/yazi
|
|
|
|
yazi = {
|
|
|
|
manager = {
|
|
|
|
# 1/8 width for parent, 4/8 width for current, 3/8 width for preview
|
2024-10-21 12:31:30 +07:00
|
|
|
ratio = [
|
|
|
|
1
|
|
|
|
4
|
|
|
|
3
|
|
|
|
];
|
2024-06-26 13:25:55 +07:00
|
|
|
sort_by = "natural";
|
|
|
|
sort_sensitive = false;
|
|
|
|
sort_dir_first = true;
|
2024-10-08 15:47:58 +07:00
|
|
|
linemode = "size";
|
2024-06-26 13:25:55 +07:00
|
|
|
show_hidden = true;
|
|
|
|
show_symlink = true;
|
|
|
|
scrolloff = 5;
|
|
|
|
};
|
|
|
|
opener = {
|
|
|
|
edit = [
|
2024-10-21 12:31:30 +07:00
|
|
|
{
|
|
|
|
run = ''nvim "$@"'';
|
|
|
|
block = true;
|
|
|
|
desc = "Edit in Neovim";
|
|
|
|
}
|
2024-06-26 13:25:55 +07:00
|
|
|
];
|
|
|
|
play = [
|
2024-10-21 12:31:30 +07:00
|
|
|
{
|
|
|
|
run = ''mpv "$@"'';
|
|
|
|
orphan = true;
|
|
|
|
desc = "Play in MPV";
|
|
|
|
}
|
2024-06-26 13:25:55 +07:00
|
|
|
];
|
|
|
|
open = [
|
2024-10-21 12:31:30 +07:00
|
|
|
{
|
|
|
|
run = ''xdg-open "$@"'';
|
|
|
|
desc = "Open";
|
|
|
|
}
|
2024-06-26 13:25:55 +07:00
|
|
|
];
|
|
|
|
};
|
|
|
|
open = {
|
|
|
|
rules = [
|
|
|
|
{
|
|
|
|
mime = "text/*";
|
|
|
|
use = "edit";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
mime = "video/*";
|
|
|
|
use = "play";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
mime = "application/json";
|
|
|
|
use = "edit";
|
|
|
|
}
|
|
|
|
# Multiple openers for a single rule
|
|
|
|
{
|
|
|
|
name = "*.html";
|
2024-10-21 12:31:30 +07:00
|
|
|
use = [
|
|
|
|
"open"
|
|
|
|
"edit"
|
|
|
|
];
|
2024-06-26 13:25:55 +07:00
|
|
|
}
|
|
|
|
];
|
|
|
|
append_rules = [
|
2024-10-21 12:31:30 +07:00
|
|
|
{
|
|
|
|
name = "*";
|
|
|
|
use = "open";
|
|
|
|
}
|
2024-06-26 13:25:55 +07:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|