snowflake/home/yazi/openers.nix

72 lines
1.1 KiB
Nix
Raw Normal View History

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