init
This commit is contained in:
commit
714d050757
139 changed files with 27826 additions and 0 deletions
53
bin/.bin/fuzzel.lua
Normal file
53
bin/.bin/fuzzel.lua
Normal file
|
@ -0,0 +1,53 @@
|
|||
return {
|
||||
selector_cmd = function()
|
||||
return {
|
||||
command = "rofi",
|
||||
args = { "-dmenu", "-p", "Project: " },
|
||||
}
|
||||
end,
|
||||
editor_cmd = function(path, class)
|
||||
local dirName = path:match("([^/]+)$")
|
||||
-- Sanitize dirName for tmux session name (remove special chars)
|
||||
local tmuxSession = dirName:gsub("[^a-zA-Z0-9_]", "_")
|
||||
|
||||
local tmuxCmd = string.format(
|
||||
[[ tmux has-session -t %s 2>/dev/null && tmux attach -t %s || tmux new -c %s -s %s 'nvim %s' \; split-window -h -c %s ]],
|
||||
tmuxSession,
|
||||
tmuxSession,
|
||||
path,
|
||||
tmuxSession,
|
||||
path,
|
||||
path
|
||||
)
|
||||
return {
|
||||
command = "kitty",
|
||||
args = {
|
||||
"-d",
|
||||
path,
|
||||
"-T",
|
||||
class,
|
||||
"--class",
|
||||
class,
|
||||
"sh",
|
||||
"-c",
|
||||
tmuxCmd,
|
||||
},
|
||||
}
|
||||
end,
|
||||
format_project_title = function(path)
|
||||
-- Extract project name for better display
|
||||
-- local projectName = path:match("([^/]+)$") or path
|
||||
return "📘 " .. path
|
||||
end,
|
||||
|
||||
extract_path_from_title = function(title)
|
||||
-- Return back the path: 📘 work/project_1 -> work/project_1
|
||||
return title:gsub("^📘%s*", ""):gsub("\n$", "")
|
||||
end,
|
||||
|
||||
-- Add error handling function
|
||||
handle_error = function(err)
|
||||
io.stderr:write("Error: " .. tostring(err) .. "\n")
|
||||
return false
|
||||
end,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue