feat: add inode/x-empty and application/json as text

This commit is contained in:
sxyazi 2023-08-12 19:57:48 +08:00
parent d881614d31
commit 9d937fe376
No known key found for this signature in database
2 changed files with 15 additions and 13 deletions

View File

@ -10,30 +10,30 @@ max_height = 900
[opener]
folder = [
{ exec = "open -R $*", display_name = "Reveal in Finder" },
{ exec = "vim $*" },
{ exec = 'open -R "$@"', display_name = "Reveal in Finder" },
{ exec = 'vim "$@"' },
]
archive = [
{ exec = "unar $1", display_name = "Extract here" },
{ exec = 'unar "$1"', display_name = "Extract here" },
]
text = [
{ exec = "vim $*", block = true },
{ exec = 'vim "$@"', block = true },
]
image = [
{ exec = "open $*", display_name = "Open" },
{ exec = "exiftool $1; echo '\n\nPress enter to exit'; read", block = true, display_name = "Show EXIF" },
{ exec = 'open "$@"', display_name = "Open" },
{ exec = '''exiftool "$1"; echo "Press enter to exit"; read''', block = true, display_name = "Show EXIF" },
]
video = [
{ exec = "mpv $*" },
{ exec = "mediainfo $1; echo '\n\nPress enter to exit'; read", block = true, display_name = "Show media info" },
{ exec = 'mpv "$@"' },
{ exec = '''mediainfo "$1"; echo "Press enter to exit"; read''', block = true, display_name = "Show media info" },
]
audio = [
{ exec = "mpv $*" },
{ exec = "mediainfo $1; echo '\n\nPress enter to exit'; read", block = true, display_name = "Show media info" },
{ exec = 'mpv "$@"' },
{ exec = '''mediainfo "$1"; echo "Press enter to exit"; read''', block = true, display_name = "Show media info" },
]
fallback = [
{ exec = "open $*", display_name = "Open" },
{ exec = "open -R $*", display_name = "Reveal in Finder" },
{ exec = 'open "$@"', display_name = "Open" },
{ exec = 'open -R "$@"', display_name = "Reveal in Finder" },
]
[open]
@ -45,6 +45,8 @@ rules = [
{ mime = "image/*", use = "image" },
{ mime = "video/*", use = "video" },
{ mime = "audio/*", use = "audio" },
{ mime = "inode/x-empty", use = "text" },
{ mime = "application/json", use = "text" },
{ mime = "application/x-bzip", use = "archive" },
{ mime = "application/x-bzip2", use = "archive" },

View File

@ -38,7 +38,7 @@ impl<'de> Deserialize<'de> for Opener {
}
println!(
"WARNING: `cmd` and `args` are deprecated in favor of `exec` in Yazi v0.1.5, see https://github.com/sxyazi/yazi/pull/45"
"WARNING: `cmd` and `args` will be deprecated in favor of `exec` in Yazi v0.1.5, see https://github.com/sxyazi/yazi/pull/45"
);
// Replace the $0 to $1, $1 to $2, and so on