diff options
| author | subh <subh@subh.space> | 2026-04-03 14:47:03 +0530 |
|---|---|---|
| committer | subh <subh@subh.space> | 2026-04-03 14:47:03 +0530 |
| commit | 314d760de1922128124f2a9be0494fd4f6f7effb (patch) | |
| tree | 3f4bb374fc89be2b1cd4e2a0a21ae17d4bf83452 /yazi/init.lua | |
| parent | 0203dd4b8d45c663356f797c11be17fdec6f22f2 (diff) | |
new music bar, auto usb mounting and more
Diffstat (limited to 'yazi/init.lua')
| -rw-r--r-- | yazi/init.lua | 128 |
1 files changed, 128 insertions, 0 deletions
diff --git a/yazi/init.lua b/yazi/init.lua new file mode 100644 index 0000000..7568c87 --- /dev/null +++ b/yazi/init.lua @@ -0,0 +1,128 @@ +require("full-border"):setup() +require("fs-usage"):setup() + +function Linemode:size_and_mtime() + + local time = math.floor(self._file.cha.mtime or 0) + if time == 0 then + time = "" + elseif os.date("%Y", time) == os.date("%Y") then + time = os.date("%b %d %H:%M", time) + else + time = os.date("%b %d %Y", time) + end + + local size = self._file:size() + return string.format("%s %s", size and ya.readable_size(size) or "-", time) +end + + + +require("lin-decompress"):setup({ + -- Global commands for all .tar.* archives (e.g. .tar.lz, .tar.lzo, .tar.gz) + global_tar_compressor = { + -- Commands for each .tar.* archive, + -- Appends these 'cmd's only if 'no_global_tar = false' is set for a .tar.* configuration below + cmd = { "-dkc" }, + }, + + -- NOTE: Use the '[name of mimetype]' portion when defining new extractors' + -- + -- Schema: + -- ["application/[<name of mimetype>]"] ={ + -- tool_name = "Name of tool to use for this mimetype", + -- cmd = { list of arguments to use}, + -- no_global_tar = true (default: false) (Appends the commands specified in the 'global_tar_compressor.cmd') + -- exts = {extension_name = true, ...} (Extension names of the archive to extract. Used only as a fallback in case mime detection fails) + -- } + -- Configurations for compressors commonly used with .tar.* + tar_compressors = { + ["lz4"] = { + tool_name = "lz4", + exts = { + lz4 = true, + }, + }, + ["xz"] = { + tool_name = "xz", + cmd = { "-T0" }, + exts = { + xz = true, + }, + }, + ["gzip"] = { + tool_name = "gzip", + exts = { + gz = true, + }, + }, + ["compress"] = { + tool_name = "uncompress", + exts = { + Z = true, + }, + }, + ["bzip2"] = { + tool_name = "bzip2", + exts = { + bz2 = true, + }, + }, + ["zstd"] = { + tool_name = "zstd", + cmd = { "-T0" }, + exts = { + zst = true, + }, + }, + ["lzop"] = { + tool_name = "lzop", + exts = { + lzo = true, + }, + }, + ["lzip"] = { + tool_name = "lzip", + exts = { + lz = true, + }, + }, + ["lzma"] = { + tool_name = "lzma", + exts = { + lzma = true, + }, + }, + }, + -- NOTE: Use the '[name of mimetype]' portion when defining new extractors' + -- + -- Schema: + -- ["application/[name of mimetype]"] ={ + -- tool_name = "Name of tool to use", + -- cmd = {list of arguments to use }, + -- out_cmd = "The command to output extracted content", + -- pw_cmd = "Command to input a Password" + -- exts = {extension_name = true, ...} (Extension names of the archive to extract. Used only as a fallback in case mime detection fails) + -- } + -- Configurations for non .tar archives + other_compressors = { + ["rar"] = { + tool_name = "unrar", + cmd = { "x" }, + out_cmd = "-op", + pw_cmd = "-p", + exts = { + rar = true, + }, + }, + -- The default tool to use to extract ALL types of archive files + ["default"] = { + tool_name = "7z", + cmd = { "x", "-mmt=0" }, + out_cmd = "-o", + pw_cmd = "-p", + }, + }, +}) + + |
