made import module and added runtime.lua
This commit is contained in:
19
autoload.lua
19
autoload.lua
@@ -16,15 +16,20 @@ else
|
|||||||
modules = os.getenv("HOME") .. "/.config/hypr/modules"
|
modules = os.getenv("HOME") .. "/.config/hypr/modules"
|
||||||
end
|
end
|
||||||
|
|
||||||
local pluginsOk, pluginsErr = pcall(dofile, hyprRoot .. "/plugins.lua")
|
local function importRelativeModule(module)
|
||||||
if not pluginsOk then
|
local ok, err = pcall(dofile, hyprRoot .. "/" .. module)
|
||||||
hl.notification.create({
|
if not ok then
|
||||||
text = "autoload: " .. hyprRoot .. "plugins.lua" .. "\n" .. tostring(pluginsErr),
|
hl.notification.create({
|
||||||
timeout = 8000,
|
text = "autoload: " .. hyprRoot .. module .. "\n" .. tostring(err),
|
||||||
icon = "warning",
|
timeout = 8000,
|
||||||
})
|
icon = "warning",
|
||||||
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
importRelativeModule("plugins.lua")
|
||||||
|
importRelativeModule("runtime.lua")
|
||||||
|
|
||||||
-- Get all files in modules dir
|
-- Get all files in modules dir
|
||||||
local p = io.popen('find -L "' .. modules .. '" -name "*.lua" -type f | sort')
|
local p = io.popen('find -L "' .. modules .. '" -name "*.lua" -type f | sort')
|
||||||
if not p then
|
if not p then
|
||||||
|
|||||||
Reference in New Issue
Block a user