From 721e00df27220d4ca28c4e1f094a3885187e459b Mon Sep 17 00:00:00 2001 From: Uyanide Date: Wed, 31 Dec 2025 16:40:08 +0100 Subject: [PATCH] yazi: upgrade --- config/niri/.config/niri/config/misc.kdl | 2 +- config/yazi/.config/yazi/package.toml | 14 +- .../.config/yazi/plugins/git.yazi/README.md | 14 +- .../.config/yazi/plugins/git.yazi/main.lua | 20 +- .../.config/yazi/plugins/git.yazi/types.lua | 12 + .../.config/yazi/plugins/yamb.yazi/README.md | 44 +- .../.config/yazi/plugins/yamb.yazi/main.lua | 632 +++++++++--------- .../yazi/plugins/yaziline.yazi/README.md | 3 + memo/lfs.md | 2 + 9 files changed, 379 insertions(+), 364 deletions(-) create mode 100644 config/yazi/.config/yazi/plugins/git.yazi/types.lua diff --git a/config/niri/.config/niri/config/misc.kdl b/config/niri/.config/niri/config/misc.kdl index b6a5dca..cccfe86 100644 --- a/config/niri/.config/niri/config/misc.kdl +++ b/config/niri/.config/niri/config/misc.kdl @@ -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 { diff --git a/config/yazi/.config/yazi/package.toml b/config/yazi/.config/yazi/package.toml index d0a90a3..dff7e48 100644 --- a/config/yazi/.config/yazi/package.toml +++ b/config/yazi/.config/yazi/package.toml @@ -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 = [] diff --git a/config/yazi/.config/yazi/plugins/git.yazi/README.md b/config/yazi/.config/yazi/plugins/git.yazi/README.md index 96a87a8..23b3bbb 100644 --- a/config/yazi/.config/yazi/plugins/git.yazi/README.md +++ b/config/yazi/.config/yazi/plugins/git.yazi/README.md @@ -22,19 +22,19 @@ And register it as fetchers in your `~/.config/yazi/yazi.toml`: ```toml [[plugin.prepend_fetchers]] -id = "git" -name = "*" -run = "git" +id = "git" +url = "*" +run = "git" [[plugin.prepend_fetchers]] -id = "git" -name = "*/" -run = "git" +id = "git" +url = "*/" +run = "git" ``` ## Advanced -> [!NOTE] +> [!NOTE] > The following configuration must be put before `require("git"):setup()` You can customize the [Style](https://yazi-rs.github.io/docs/plugins/layout#style) of the status sign with: diff --git a/config/yazi/.config/yazi/plugins/git.yazi/main.lua b/config/yazi/.config/yazi/plugins/git.yazi/main.lua index 66ef3bb..71c5429 100644 --- a/config/yazi/.config/yazi/plugins/git.yazi/main.lua +++ b/config/yazi/.config/yazi/plugins/git.yazi/main.lua @@ -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 + ui.render() 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 + ui.render() 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 diff --git a/config/yazi/.config/yazi/plugins/git.yazi/types.lua b/config/yazi/.config/yazi/plugins/git.yazi/types.lua new file mode 100644 index 0000000..9936849 --- /dev/null +++ b/config/yazi/.config/yazi/plugins/git.yazi/types.lua @@ -0,0 +1,12 @@ +---@class State +---@field dirs table Mapping between a directory and its corresponding repository +---@field repos table 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 diff --git a/config/yazi/.config/yazi/plugins/yamb.yazi/README.md b/config/yazi/.config/yazi/plugins/yamb.yazi/README.md index 5f322de..26f82db 100644 --- a/config/yazi/.config/yazi/plugins/yamb.yazi/README.md +++ b/config/yazi/.config/yazi/plugins/yamb.yazi/README.md @@ -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" ``` diff --git a/config/yazi/.config/yazi/plugins/yamb.yazi/main.lua b/config/yazi/.config/yazi/plugins/yamb.yazi/main.lua index 383b492..1c61426 100644 --- a/config/yazi/.config/yazi/plugins/yamb.yazi/main.lua +++ b/config/yazi/.config/yazi/plugins/yamb.yazi/main.lua @@ -1,355 +1,367 @@ +--- @since 25.6.11 local path_sep = package.config:sub(1, 1) local get_hovered_path = ya.sync(function(state) - local h = cx.active.current.hovered - if h then - local path = tostring(h.url) - if h.cha.is_dir then - return path .. path_sep - end - return path - else - return '' - end + local h = cx.active.current.hovered + if h then + local path = tostring(h.url) + if h.cha.is_dir then + return path .. path_sep + end + return path + else + return "" + end end) local get_state_attr = ya.sync(function(state, attr) - return state[attr] + return state[attr] end) local set_state_attr = ya.sync(function(state, attr, value) - state[attr] = value + state[attr] = value end) local set_bookmarks = ya.sync(function(state, path, value) - state.bookmarks[path] = value + state.bookmarks[path] = value end) local sort_bookmarks = function(bookmarks, key1, key2, reverse) - reverse = reverse or false - table.sort(bookmarks, function(x, y) - if x[key1] == nil and y[key1] == nil then - return x[key2] < y[key2] - elseif x[key1] == nil then - return false - elseif y[key1] == nil then - return true - else - return x[key1] < y[key1] - end - end) - if reverse then - local n = #bookmarks - for i = 1, math.floor(n / 2) do - bookmarks[i], bookmarks[n - i + 1] = bookmarks[n - i + 1], bookmarks[i] - end - end - return bookmarks + reverse = reverse or false + table.sort(bookmarks, function(x, y) + if x[key1] == nil and y[key1] == nil then + return x[key2] < y[key2] + elseif x[key1] == nil then + return false + elseif y[key1] == nil then + return true + else + return x[key1] < y[key1] + end + end) + if reverse then + local n = #bookmarks + for i = 1, math.floor(n / 2) do + bookmarks[i], bookmarks[n - i + 1] = bookmarks[n - i + 1], bookmarks[i] + end + end + return bookmarks end local save_to_file = function(mb_path, bookmarks) - local file = io.open(mb_path, "w") - if file == nil then - return - end - local array = {} - for _, item in pairs(bookmarks) do - table.insert(array, item) - end - sort_bookmarks(array, "tag", "key", true) - for _, item in ipairs(array) do - file:write(string.format("%s\t%s\t%s\n", item.tag, item.path, item.key)) - end - file:close() + local file = io.open(mb_path, "w") + if file == nil then + return + end + local array = {} + for _, item in pairs(bookmarks) do + table.insert(array, item) + end + sort_bookmarks(array, "tag", "key", true) + for _, item in ipairs(array) do + file:write(string.format("%s\t%s\t%s\n", item.tag, item.path, item.key)) + end + file:close() end local fzf_find = function(cli, mb_path) - local permit = ya.hide() - local cmd = string.format("%s < \"%s\"", cli, mb_path) - local handle = io.popen(cmd, "r") - local result = "" - if handle then - -- strip - result = string.gsub(handle:read("*all") or "", "^%s*(.-)%s*$", "%1") - handle:close() - end - permit:drop() - local tag, path, key = string.match(result or "", "(.-)\t(.-)\t(.*)") - return path + local permit = ya.hide() + local cmd = string.format('%s < "%s"', cli, mb_path) + local handle = io.popen(cmd, "r") + local result = "" + if handle then + -- strip + result = string.gsub(handle:read("*all") or "", "^%s*(.-)%s*$", "%1") + handle:close() + end + permit:drop() + local tag, path, key = string.match(result or "", "(.-)\t(.-)\t(.*)") + return path end local which_find = function(bookmarks) - local cands = {} - for path, item in pairs(bookmarks) do - if #item.tag ~= 0 then - table.insert(cands, { desc = item.tag, on = item.key, path = item.path }) - end - end - sort_bookmarks(cands, "on", "desc", false) - if #cands == 0 then - ya.notify { - title = "Bookmarks", - content = "Empty bookmarks", - timeout = 2, - level = "info", - } - return nil - end - local idx = ya.which { cands = cands } - if idx == nil then - return nil - end - return cands[idx].path + local cands = {} + for path, item in pairs(bookmarks) do + if #item.tag ~= 0 then + table.insert(cands, { desc = item.tag, on = item.key, path = item.path }) + end + end + sort_bookmarks(cands, "on", "desc", false) + if #cands == 0 then + ya.notify({ + title = "Bookmarks", + content = "Empty bookmarks", + timeout = 2, + level = "info", + }) + return nil + end + local idx = ya.which({ cands = cands }) + if idx == nil then + return nil + end + return cands[idx].path end local action_jump = function(bookmarks, path, jump_notify) - if path == nil then - return - end - local tag = bookmarks[path].tag - if string.sub(path, -1) == path_sep then - ya.manager_emit("cd", { path }) - else - ya.manager_emit("reveal", { path }) - end - if jump_notify then - ya.notify { - title = "Bookmarks", - content = 'Jump to "' .. tag .. '"', - timeout = 2, - level = "info", - } - end + if path == nil then + return + end + local tag = bookmarks[path].tag + if string.sub(path, -1) == path_sep then + ya.emit("cd", { path, raw = true }) + else + ya.emit("reveal", { path, no_dummy = true, raw = true }) + end + if jump_notify then + ya.notify({ + title = "Bookmarks", + content = 'Jump to "' .. tag .. '"', + timeout = 2, + level = "info", + }) + end end local generate_key = function(bookmarks) - local keys = get_state_attr("keys") - local key2rank = get_state_attr("key2rank") - local mb = {} - for _, item in pairs(bookmarks) do - if #item.key == 1 then - table.insert(mb, item.key) - end - end - if #mb == 0 then - return keys[1] - end - table.sort(mb, function(a, b) - return key2rank[a] < key2rank[b] - end) - local idx = 1 - for _, key in ipairs(keys) do - if idx > #mb or key2rank[key] < key2rank[mb[idx]] then - return key - end - idx = idx + 1 - end - return nil + local keys = get_state_attr("keys") + local key2rank = get_state_attr("key2rank") + local mb = {} + for _, item in pairs(bookmarks) do + if #item.key == 1 then + table.insert(mb, item.key) + end + end + if #mb == 0 then + return keys[1] + end + table.sort(mb, function(a, b) + return key2rank[a] < key2rank[b] + end) + local idx = 1 + for _, key in ipairs(keys) do + if idx > #mb or key2rank[key] < key2rank[mb[idx]] then + return key + end + idx = idx + 1 + end + return nil end local action_save = function(mb_path, bookmarks, path) - if path == nil or #path == 0 then - return - end + if path == nil or #path == 0 then + return + end - local path_obj = bookmarks[path] - -- check tag - local tag = path_obj and path_obj.tag or path:match(".*[\\/]([^\\/]+)[\\/]?$") - while true do - local value, event = ya.input({ - title = "Tag (alias name)", - value = tag, - position = { "top-center", y = 3, w = 40 }, - }) - if event ~= 1 then - return - end - tag = value or '' - if #tag == 0 then - ya.notify { - title = "Bookmarks", - content = "Empty tag", - timeout = 2, - level = "info", - } - else - -- check the tag - local tag_obj = nil - for _, item in pairs(bookmarks) do - if item.tag == tag then - tag_obj = item - break - end - end - if tag_obj == nil or tag_obj.path == path then - break - end - ya.notify { - title = "Bookmarks", - content = "Duplicated tag", - timeout = 2, - level = "info", - } - end - end - -- check key - local key = path_obj and path_obj.key or generate_key(bookmarks) - while true do - local value, event = ya.input({ - title = "Key (1 character, optional)", - value = key, - position = { "top-center", y = 3, w = 40 }, - }) - if event ~= 1 then - return - end - key = value or "" - if key == "" then - key = "" - break - elseif #key == 1 then - -- check the key - local key_obj = nil - for _, item in pairs(bookmarks) do - if item.key == key then - key_obj = item - break - end - end - if key_obj == nil or key_obj.path == path then - break - else - ya.notify { - title = "Bookmarks", - content = "Duplicated key", - timeout = 2, - level = "info", - } - end - else - 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 { - title = "Bookmarks", - content = '"' .. tag .. '" saved"', - timeout = 2, - level = "info", - } + local path_obj = bookmarks[path] + -- check tag + local tag = path_obj and path_obj.tag or path:match(".*[\\/]([^\\/]+)[\\/]?$") + while true do + 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 "" + if #tag == 0 then + ya.notify({ + title = "Bookmarks", + content = "Empty tag", + timeout = 2, + level = "info", + }) + else + -- check the tag + local tag_obj = nil + for _, item in pairs(bookmarks) do + if item.tag == tag then + tag_obj = item + break + end + end + if tag_obj == nil or tag_obj.path == path then + break + end + ya.notify({ + title = "Bookmarks", + content = "Duplicated tag", + timeout = 2, + level = "info", + }) + end + end + -- check key + local key = path_obj and path_obj.key or generate_key(bookmarks) + while true do + 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 + return + end + key = value or "" + if key == "" then + key = "" + break + elseif #key == 1 then + -- check the key + local key_obj = nil + for _, item in pairs(bookmarks) do + if item.key == key then + key_obj = item + break + end + end + if key_obj == nil or key_obj.path == path then + break + else + ya.notify({ + title = "Bookmarks", + content = "Duplicated key", + timeout = 2, + level = "info", + }) + end + else + 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({ + title = "Bookmarks", + content = '"' .. tag .. '" saved"', + timeout = 2, + level = "info", + }) end local action_delete = function(mb_path, bookmarks, path) - if path == nil then - return - end - local tag = bookmarks[path].tag - set_bookmarks(path, nil) - bookmarks = get_state_attr("bookmarks") - save_to_file(mb_path, bookmarks) - ya.notify { - title = "Bookmarks", - content = '"' .. tag .. '" deleted', - timeout = 2, - level = "info", - } + if path == nil then + return + end + local tag = bookmarks[path].tag + set_bookmarks(path, nil) + bookmarks = get_state_attr("bookmarks") + save_to_file(mb_path, bookmarks) + 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)", - position = { "top-center", y = 3, w = 40 }, - }) - if event ~= 1 then - return - end - if string.lower(value) == "y" then - set_state_attr("bookmarks", {}) - save_to_file(mb_path, {}) - ya.notify { - title = "Bookmarks", - content = "All bookmarks deleted", - timeout = 2, - level = "info", - } - else - ya.notify { - title = "Bookmarks", - content = "Cancel delete", - timeout = 2, - level = "info", - } - end + 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 value and string.lower(value) == "y" then + set_state_attr("bookmarks", {}) + save_to_file(mb_path, {}) + ya.notify({ + title = "Bookmarks", + content = "All bookmarks deleted", + timeout = 2, + level = "info", + }) + else + 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.cli = options.cli or "fzf" - state.jump_notify = options.jump_notify and true - -- init the keys - local keys = options.keys or "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - state.keys = {} - state.key2rank = {} - for i = 1, #keys do - local char = keys:sub(i, i) - table.insert(state.keys, char) - state.key2rank[char] = i - end + 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.cli = options.cli or "fzf" + state.jump_notify = options.jump_notify and true + -- init the keys + local keys = options.keys or "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + state.keys = {} + state.key2rank = {} + for i = 1, #keys do + local char = keys:sub(i, i) + table.insert(state.keys, char) + state.key2rank[char] = i + end - -- init the bookmarks - local bookmarks = {} - for _, item in pairs(options.bookmarks or {}) do - bookmarks[item.path] = { tag = item.tag, path = item.path, key = item.key } - end - -- load the config - local file = io.open(state.path, "r") - if file ~= nil then - for line in file:lines() do - local tag, path, key = string.match(line, "(.-)\t(.-)\t(.*)") - if tag and path then - key = key or "" - bookmarks[path] = { tag = tag, path = path, key = key } - end - end - file:close() - end - -- create bookmarks file to enable fzf - save_to_file(state.path, bookmarks) - state.bookmarks = bookmarks - end, - entry = function(self, jobs) - local action = jobs.args[1] - 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") - if action == "save" then - action_save(mb_path, bookmarks, get_hovered_path()) - elseif action == "delete_by_key" then - action_delete(mb_path, bookmarks, which_find(bookmarks)) - elseif action == "delete_by_fzf" then - action_delete(mb_path, bookmarks, fzf_find(cli, mb_path)) - elseif action == "delete_all" then - action_delete_all(mb_path) - elseif action == "jump_by_key" then - action_jump(bookmarks, which_find(bookmarks), jump_notify) - elseif action == "jump_by_fzf" then - action_jump(bookmarks, fzf_find(cli, mb_path), jump_notify) - elseif action == "rename_by_key" then - action_save(mb_path, bookmarks, which_find(bookmarks)) - elseif action == "rename_by_fzf" then - action_save(mb_path, bookmarks, fzf_find(cli, mb_path)) - end - end, + -- init the bookmarks + 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") + if file ~= nil then + for line in file:lines() do + local tag, path, key = string.match(line, "(.-)\t(.-)\t(.*)") + if tag and path then + key = key or "" + bookmarks[path] = { tag = tag, path = path, key = key } + end + end + file:close() + end + -- create bookmarks file to enable fzf + save_to_file(state.path, bookmarks) + state.bookmarks = bookmarks + end, + entry = function(self, jobs) + local action = jobs.args[1] + 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") + if action == "save" then + action_save(mb_path, bookmarks, get_hovered_path()) + elseif action == "delete_by_key" then + action_delete(mb_path, bookmarks, which_find(bookmarks)) + elseif action == "delete_by_fzf" then + action_delete(mb_path, bookmarks, fzf_find(cli, mb_path)) + elseif action == "delete_all" then + action_delete_all(mb_path) + elseif action == "jump_by_key" then + action_jump(bookmarks, which_find(bookmarks), jump_notify) + elseif action == "jump_by_fzf" then + action_jump(bookmarks, fzf_find(cli, mb_path), jump_notify) + elseif action == "rename_by_key" then + action_save(mb_path, bookmarks, which_find(bookmarks)) + elseif action == "rename_by_fzf" then + action_save(mb_path, bookmarks, fzf_find(cli, mb_path)) + end + end, } diff --git a/config/yazi/.config/yazi/plugins/yaziline.yazi/README.md b/config/yazi/.config/yazi/plugins/yaziline.yazi/README.md index 9cf6426..5291f00 100644 --- a/config/yazi/.config/yazi/plugins/yaziline.yazi/README.md +++ b/config/yazi/.config/yazi/plugins/yaziline.yazi/README.md @@ -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) | diff --git a/memo/lfs.md b/memo/lfs.md index e559e08..3c78e28 100644 --- a/memo/lfs.md +++ b/memo/lfs.md @@ -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 模块在特定条件下构建时可能会出现错误,日志的一部分如下: