Update xplr config
This commit is contained in:
parent
c047fe2d55
commit
25439ab68d
3 changed files with 55 additions and 2 deletions
|
@ -19,7 +19,7 @@ local function filetype(n)
|
|||
local type = "other"
|
||||
if n.is_file then
|
||||
local mime = mimetype(n)
|
||||
if (mime:match("text") or mime:match("json") or mime:match("csv") or mime:match("empty")) then
|
||||
if (mime:match("text") or mime:match("json") or mime:match("csv") or mime:match("empty") or mime:match("javascript")) then
|
||||
type = "text"
|
||||
elseif (mime:match("zip") or mime:match("tar")) then
|
||||
type = "archive"
|
||||
|
@ -49,6 +49,8 @@ local function render_text(n, ctx)
|
|||
end
|
||||
|
||||
local function render_image(n, ctx)
|
||||
-- xplr doesn't support image protocols such as sixel or kitty
|
||||
-- so we need to render blocks instead
|
||||
local result = xplr.util.shell_execute("viu",
|
||||
{ "--blocks", "--static", "--width", ctx.layout_size.width, n.absolute_path })
|
||||
return (result.returncode == 0 and result.stdout) or stats(n)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue