snowflake/home/programs/terminal/yazi/openers.nix

55 lines
960 B
Nix
Raw Normal View History

2024-01-17 14:40:02 -05:00
{pkgs, ...}: {
programs.yazi.settings = {
open.rules = [
{
mime = "text/*";
use = ["edit" "reveal"];
}
{
mime = "image/*";
use = ["image" "reveal"];
}
{
mime = "video/*";
use = ["play" "reveal"];
}
{
mime = "application/json";
use = ["edit" "reveal"];
}
{
mime = "*";
use = ["edit" "open" "reveal"];
}
];
opener = {
text = [
{
2024-04-23 12:51:15 -04:00
run = ''hx "$@" '';
2024-01-17 14:40:02 -05:00
for = "linux";
}
];
image = [
{
2024-04-23 12:51:15 -04:00
run = ''imv "$@" '';
2024-01-17 14:40:02 -05:00
block = true;
for = "linux";
}
];
video = [
{
2024-04-23 12:51:15 -04:00
run = ''mpv "$@" '';
2024-01-17 14:40:02 -05:00
block = true;
for = "linux";
}
];
reveal = [
{
2024-04-23 12:51:15 -04:00
run = ''${pkgs.exiftool}/bin/exiftool "$1";'';
2024-01-17 14:40:02 -05:00
block = true;
}
];
};
};
}