yazi: upgrade

This commit is contained in:
2025-12-31 16:40:08 +01:00
parent 19026e28d9
commit 721e00df27
9 changed files with 379 additions and 364 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
screenshot-path "~/Pictures/Screenshots/niri_screenshot_%Y-%m-%d_%H-%M-%S.png"
debug {
render-drm-device "/dev/dri/card2"
render-drm-device "/dev/dri/card0"
}
// gestures {
+7 -7
View File
@@ -1,17 +1,17 @@
[[plugin.deps]]
use = "yazi-rs/plugins:git"
rev = "2301ff8"
hash = "27ca02f49fd236b5cc7bf03c243859fe"
rev = "398796d"
hash = "73788c7dc5827ef4677c502c3ea8fa19"
[[plugin.deps]]
use = "yazi-rs/plugins:smart-enter"
rev = "2301ff8"
rev = "398796d"
hash = "56fdabc96fc1f4d53c96eb884b02a5be"
[[plugin.deps]]
use = "h-hg/yamb"
rev = "22af003"
hash = "7cc42012a7c2099f80064d228feb8d44"
rev = "5f2e22e"
hash = "699fe07e0d2d1b4af8dafb84168eeb04"
[[plugin.deps]]
use = "KKV9/compress"
@@ -20,8 +20,8 @@ hash = "e17c11b605d989568a1d1741ca17c584"
[[plugin.deps]]
use = "llanosrocas/yaziline"
rev = "e7042a8"
hash = "9c2ab18ff5368056904e4ebb61b17571"
rev = "6266926"
hash = "9917ab5cb9bdbab7ca7f2501f84f0f11"
[flavor]
deps = []
@@ -23,12 +23,12 @@ And register it as fetchers in your `~/.config/yazi/yazi.toml`:
```toml
[[plugin.prepend_fetchers]]
id = "git"
name = "*"
url = "*"
run = "git"
[[plugin.prepend_fetchers]]
id = "git"
name = "*/"
url = "*/"
run = "git"
```
@@ -1,4 +1,4 @@
--- @since 25.5.31
--- @since 25.12.29
local WINDOWS = ya.target_family() == "windows"
@@ -125,12 +125,7 @@ local add = ya.sync(function(st, cwd, repo, changed)
st.repos[repo][path] = code
end
end
-- TODO: remove this
if ui.render then
ui.render()
else
ya.render()
end
end)
---@param cwd string
@@ -142,12 +137,7 @@ local remove = ya.sync(function(st, cwd)
return
end
-- TODO: remove this
if ui.render then
ui.render()
else
ya.render()
end
st.dirs[cwd] = nil
if not st.repos[repo] then
return
@@ -189,6 +179,10 @@ local function setup(st, opts)
}
Linemode:children_add(function(self)
if not self._file.in_current then
return ""
end
local url = self._file.url
local repo = st.dirs[tostring(url.base or url.parent)]
local code
@@ -0,0 +1,12 @@
---@class State
---@field dirs table<string, string|CODES> Mapping between a directory and its corresponding repository
---@field repos table<string, Changes> Mapping between a repository and the status of each of its files
---@class Options
---@field order number The order in which the status is displayed
---@field renamed boolean Whether to include renamed files in the status (or treat them as modified)
-- TODO: move this to `types.yazi` once it's get stable
---@alias UnstableFetcher fun(self: unknown, job: { files: File[] }): boolean, Error?
---@alias Changes table<string, CODES>
@@ -10,17 +10,10 @@ A [Yazi](https://github.com/sxyazi/yazi) plugin for bookmark management, support
## Installation
> [!NOTE]
> Yazi >= 0.25.
> Yazi >= 25.6.11
```sh
# Linux/macOS
git clone https://github.com/h-hg/yamb.yazi.git ~/.config/yazi/plugins/yamb.yazi
# Windows
git clone https://github.com/h-hg/yamb.yazi.git $env:APPDATA\yazi\config\plugins\yamb.yazi
# if you are using Yazi version >= 3.0
ya pack -a h-hg/yamb
ya pkg add h-hg/yamb
```
## Usage
@@ -36,7 +29,6 @@ local home_path = ya.target_family() == "windows" and os.getenv("USERPROFILE") o
if ya.target_family() == "windows" then
table.insert(bookmarks, {
tag = "Scoop Local",
path = (os.getenv("SCOOP") or home_path .. "\\scoop") .. "\\",
key = "p"
})
@@ -70,43 +62,43 @@ require("yamb"):setup {
Add this to your `keymap.toml`:
```toml
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = [ "u", "a" ]
run = "plugin yamb save"
run = "plugin yamb -- save"
desc = "Add bookmark"
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = [ "u", "g" ]
run = "plugin yamb jump_by_key"
run = "plugin yamb -- jump_by_key"
desc = "Jump bookmark by key"
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = [ "u", "G" ]
run = "plugin yamb jump_by_fzf"
run = "plugin yamb -- jump_by_fzf"
desc = "Jump bookmark by fzf"
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = [ "u", "d" ]
run = "plugin yamb delete_by_key"
run = "plugin yamb -- delete_by_key"
desc = "Delete bookmark by key"
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = [ "u", "D" ]
run = "plugin yamb delete_by_fzf"
run = "plugin yamb -- delete_by_fzf"
desc = "Delete bookmark by fzf"
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = [ "u", "A" ]
run = "plugin yamb delete_all"
run = "plugin yamb -- delete_all"
desc = "Delete all bookmarks"
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = [ "u", "r" ]
run = "plugin yamb rename_by_key"
run = "plugin yamb -- rename_by_key"
desc = "Rename bookmark by key"
[[manager.prepend_keymap]]
[[mgr.prepend_keymap]]
on = [ "u", "R" ]
run = "plugin yamb rename_by_fzf"
run = "plugin yamb -- rename_by_fzf"
desc = "Rename bookmark by fzf"
```
@@ -1,3 +1,4 @@
--- @since 25.6.11
local path_sep = package.config:sub(1, 1)
local get_hovered_path = ya.sync(function(state)
@@ -9,7 +10,7 @@ local get_hovered_path = ya.sync(function(state)
end
return path
else
return ''
return ""
end
end)
@@ -65,7 +66,7 @@ end
local fzf_find = function(cli, mb_path)
local permit = ya.hide()
local cmd = string.format("%s < \"%s\"", cli, mb_path)
local cmd = string.format('%s < "%s"', cli, mb_path)
local handle = io.popen(cmd, "r")
local result = ""
if handle then
@@ -87,15 +88,15 @@ local which_find = function(bookmarks)
end
sort_bookmarks(cands, "on", "desc", false)
if #cands == 0 then
ya.notify {
ya.notify({
title = "Bookmarks",
content = "Empty bookmarks",
timeout = 2,
level = "info",
}
})
return nil
end
local idx = ya.which { cands = cands }
local idx = ya.which({ cands = cands })
if idx == nil then
return nil
end
@@ -108,17 +109,17 @@ local action_jump = function(bookmarks, path, jump_notify)
end
local tag = bookmarks[path].tag
if string.sub(path, -1) == path_sep then
ya.manager_emit("cd", { path })
ya.emit("cd", { path, raw = true })
else
ya.manager_emit("reveal", { path })
ya.emit("reveal", { path, no_dummy = true, raw = true })
end
if jump_notify then
ya.notify {
ya.notify({
title = "Bookmarks",
content = 'Jump to "' .. tag .. '"',
timeout = 2,
level = "info",
}
})
end
end
@@ -159,19 +160,21 @@ local action_save = function(mb_path, bookmarks, path)
local value, event = ya.input({
title = "Tag (alias name)",
value = tag,
pos = { "top-center", y = 3, w = 40 },
-- TODO: remove this after next yazi released
position = { "top-center", y = 3, w = 40 },
})
if event ~= 1 then
return
end
tag = value or ''
tag = value or ""
if #tag == 0 then
ya.notify {
ya.notify({
title = "Bookmarks",
content = "Empty tag",
timeout = 2,
level = "info",
}
})
else
-- check the tag
local tag_obj = nil
@@ -184,12 +187,12 @@ local action_save = function(mb_path, bookmarks, path)
if tag_obj == nil or tag_obj.path == path then
break
end
ya.notify {
ya.notify({
title = "Bookmarks",
content = "Duplicated tag",
timeout = 2,
level = "info",
}
})
end
end
-- check key
@@ -198,6 +201,8 @@ local action_save = function(mb_path, bookmarks, path)
local value, event = ya.input({
title = "Key (1 character, optional)",
value = key,
pos = { "top-center", y = 3, w = 40 },
-- TODO: remove this after next yazi released
position = { "top-center", y = 3, w = 40 },
})
if event ~= 1 then
@@ -219,32 +224,32 @@ local action_save = function(mb_path, bookmarks, path)
if key_obj == nil or key_obj.path == path then
break
else
ya.notify {
ya.notify({
title = "Bookmarks",
content = "Duplicated key",
timeout = 2,
level = "info",
}
})
end
else
ya.notify {
ya.notify({
title = "Bookmarks",
content = "The length of key shoule be 1",
timeout = 2,
level = "info",
}
})
end
end
-- save
set_bookmarks(path, { tag = tag, path = path, key = key })
bookmarks = get_state_attr("bookmarks")
save_to_file(mb_path, bookmarks)
ya.notify {
ya.notify({
title = "Bookmarks",
content = '"' .. tag .. '" saved"',
timeout = 2,
level = "info",
}
})
end
local action_delete = function(mb_path, bookmarks, path)
@@ -255,46 +260,48 @@ local action_delete = function(mb_path, bookmarks, path)
set_bookmarks(path, nil)
bookmarks = get_state_attr("bookmarks")
save_to_file(mb_path, bookmarks)
ya.notify {
ya.notify({
title = "Bookmarks",
content = '"' .. tag .. '" deleted',
timeout = 2,
level = "info",
}
})
end
local action_delete_all = function(mb_path)
local value, event = ya.input({
title = "Delete all bookmarks? (y/n)",
pos = { "top-center", y = 3, w = 40 },
-- TODO: remove this after next yazi released
position = { "top-center", y = 3, w = 40 },
})
if event ~= 1 then
return
end
if string.lower(value) == "y" then
if value and string.lower(value) == "y" then
set_state_attr("bookmarks", {})
save_to_file(mb_path, {})
ya.notify {
ya.notify({
title = "Bookmarks",
content = "All bookmarks deleted",
timeout = 2,
level = "info",
}
})
else
ya.notify {
ya.notify({
title = "Bookmarks",
content = "Cancel delete",
timeout = 2,
level = "info",
}
})
end
end
return {
setup = function(state, options)
state.path = options.path or
(ya.target_family() == "windows" and os.getenv("APPDATA") .. "\\yazi\\config\\bookmark") or
(os.getenv("HOME") .. "/.config/yazi/bookmark")
state.path = options.path
or (ya.target_family() == "windows" and os.getenv("APPDATA") .. "\\yazi\\config\\bookmark")
or (os.getenv("HOME") .. "/.config/yazi/bookmark")
state.cli = options.cli or "fzf"
state.jump_notify = options.jump_notify and true
-- init the keys
@@ -311,6 +318,10 @@ return {
local bookmarks = {}
for _, item in pairs(options.bookmarks or {}) do
bookmarks[item.path] = { tag = item.tag, path = item.path, key = item.key }
if not state.key2rank[item.key] then
state.key2rank[item.key] = #state.key2rank + 1
state.keys[#state.keys + 1] = item.key
end
end
-- load the config
local file = io.open(state.path, "r")
@@ -333,7 +344,8 @@ return {
if not action then
return
end
local mb_path, cli, bookmarks, jump_notify = get_state_attr("path"), get_state_attr("cli"), get_state_attr("bookmarks"), get_state_attr("jump_notify")
local mb_path, cli, bookmarks, jump_notify =
get_state_attr("path"), get_state_attr("cli"), get_state_attr("bookmarks"), get_state_attr("jump_notify")
if action == "save" then
action_save(mb_path, bookmarks, get_hovered_path())
elseif action == "delete_by_key" then
@@ -24,6 +24,9 @@ This setup allows shipping stable versions on time, while giving early access to
| yaziline | yazi |
| :------------------------------------------------------------------------: | ----------------------------------------------------------------------------------------- |
| [v2.5.2](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.2) | [v25.12.29](https://github.com/sxyazi/yazi/releases/tag/v25.12.29) |
| [v2.5.2](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.2) | [2f66561](https://github.com/sxyazi/yazi/commit/2f66561a8251f8788b2b0fd366af90555ecafc86) |
| [v2.5.2](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.2) | [6cfa92f](https://github.com/sxyazi/yazi/commit/6cfa92f11205d212155579b5b76d4cbabe723829) |
| [v2.5.2](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.2) | [917e1f5](https://github.com/sxyazi/yazi/commit/917e1f54a10445f2e25147c4b81a3c77d8233632) |
| [v2.5.1](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.1) | [917e1f5](https://github.com/sxyazi/yazi/commit/917e1f54a10445f2e25147c4b81a3c77d8233632) |
| [v2.5.0](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.0) | [v25.5.28](https://github.com/sxyazi/yazi/releases/tag/v25.5.28) |
+2
View File
@@ -358,6 +358,8 @@
- 同时启用 Vulkan 上下文中的软件光栅化驱动 swrast 以防万一。
- `-D glvnd=enabled`:启用 GLVND 支持以便和 NVIDIA 专有驱动兼容。libglvnd 需要[在 GLFS 书中安装](https://glfs-book.github.io/glfs/shareddeps/libglvnd.html)。
> 虽然 GLFS 中的 libglvnd 章节在开头处提到了 `If you've come here from the BLFS Mesa page, ...`,但实际上 BLFS 中的 Mesa 章节并没有提到 libglvnd 和除 nouveau 外与 NVIDIA 相关的话题。算个小坑?大概。
- [Qt-6.9.2](https://www.linuxfromscratch.org/blfs/view/stable/x/qt6.html)
此版本的 Qt 的 geoclue2 模块在特定条件下构建时可能会出现错误,日志的一部分如下: