Migrated to ansible

This commit is contained in:
2024-04-02 00:59:42 +02:00
parent c53268e307
commit 0ccf6427f2
136 changed files with 5157 additions and 1407 deletions

View File

@@ -0,0 +1,39 @@
local temp_dir = os.getenv("TEMP") or os.getenv("TMP") or "/tmp"
local file_name = temp_dir .. "/bookmark.yazi"
local save_bookmark = ya.sync(function(state, idx)
local folder = Folder:by_kind(Folder.CURRENT)
local file = io.open(file_name, "w")
if file then
file:write(tostring(folder.cwd))
file:close()
end
end)
local jump_bookmark = ya.sync(function(state, idx)
local io = require("io")
local file = io.open(file_name, "r")
if file then
local line = file:read("*line")
file:close()
ya.manager_emit("cd", { line })
ya.manager_emit("arrow", { -99999999 })
end
end)
return {
entry = function(_, args)
local action = args[1]
if not action then
return
end
if action == "save" then
save_bookmark()
elseif action == "jump" then
jump_bookmark()
end
end
}