Fix autocompilation of suckless software

This commit is contained in:
mintycube 2024-04-24 09:24:28 +05:00
parent ecb9b45a3d
commit 819e8661c3

View File

@ -80,10 +80,13 @@ local function recompile(path)
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
pattern = vim.fn.resolve(vim.fn.expand(path)),
callback = function()
vim.cmd("!sudo make install; renew-dwm")
local dir = vim.fn.fnamemodify(path, ":h")
local shell_cmd = string.format("cd %s && sudo make install && renew-dwm", dir)
vim.cmd("!" .. shell_cmd)
end,
})
end
recompile("~/.config/suckless/dwm/config.h")
recompile("~/.config/suckless/dmenu/config.h")
recompile("~/.config/suckless/st/config.h")