style: re-format
This commit is contained in:
@@ -4,9 +4,9 @@ local colorscheme = require("lua.conf.colorscheme")
|
||||
local M = {}
|
||||
|
||||
M.autostart = {
|
||||
function ()
|
||||
function()
|
||||
hl.exec_cmd("hyprctl plugin load /usr/lib/hyprland-plugins/hyprexpo.so")
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
M.confs = {
|
||||
@@ -41,7 +41,7 @@ M.binds = {
|
||||
dispatcher = function()
|
||||
hl.plugin.hyprexpo.expo("toggle")
|
||||
end,
|
||||
desc = "Toggle hyprexpo"
|
||||
desc = "Toggle hyprexpo",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
+27
-27
@@ -8,33 +8,33 @@ local M = {}
|
||||
local plugins = {}
|
||||
|
||||
local function is_plugin_exists(name)
|
||||
return utils.is_file_exists(HYPR .. "/lua/plugins/" .. name .. ".lua")
|
||||
return utils.is_file_exists(HYPR .. "/lua/plugins/" .. name .. ".lua")
|
||||
end
|
||||
|
||||
local function load_plugin(name)
|
||||
if not is_plugin_exists(name) then
|
||||
return {}
|
||||
end
|
||||
local default_plug = require("lua.plugins." .. name)
|
||||
if not is_plugin_exists(name) then
|
||||
return {}
|
||||
end
|
||||
local default_plug = require("lua.plugins." .. name)
|
||||
|
||||
local user_plugname = "lua.user.plugins." .. name
|
||||
local plug = utils.extend_config(default_plug, user_plugname)
|
||||
local user_plugname = "lua.user.plugins." .. name
|
||||
local plug = utils.extend_config(default_plug, user_plugname)
|
||||
|
||||
return plug
|
||||
return plug
|
||||
end
|
||||
|
||||
print("loading plugins...")
|
||||
|
||||
for name, enabled in pairs(settings.plugins) do
|
||||
print("plugin ".. name .." enabled is "..tostring(enabled))
|
||||
if enabled then
|
||||
local plug = load_plugin(name)
|
||||
print("plugin " .. name .. " loaded.")
|
||||
table.insert(plugins, {
|
||||
name = name,
|
||||
config = plug,
|
||||
})
|
||||
end
|
||||
print("plugin " .. name .. " enabled is " .. tostring(enabled))
|
||||
if enabled then
|
||||
local plug = load_plugin(name)
|
||||
print("plugin " .. name .. " loaded.")
|
||||
table.insert(plugins, {
|
||||
name = name,
|
||||
config = plug,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
M.autostart = {}
|
||||
@@ -42,24 +42,24 @@ M.binds = {}
|
||||
M.confs = {}
|
||||
|
||||
local function collect_plugins_prop(plugin, prop)
|
||||
if plugin[prop] then
|
||||
M[prop] = utils.list_extend(M[prop], plugin[prop])
|
||||
end
|
||||
if plugin[prop] then
|
||||
M[prop] = utils.list_extend(M[prop], plugin[prop])
|
||||
end
|
||||
end
|
||||
|
||||
for _, item in ipairs(plugins) do
|
||||
local plugin = item.config
|
||||
collect_plugins_prop(plugin, "autostart")
|
||||
collect_plugins_prop(plugin, "binds")
|
||||
collect_plugins_prop(plugin, "confs")
|
||||
local plugin = item.config
|
||||
collect_plugins_prop(plugin, "autostart")
|
||||
collect_plugins_prop(plugin, "binds")
|
||||
collect_plugins_prop(plugin, "confs")
|
||||
end
|
||||
|
||||
function M.load()
|
||||
events.map("hyprland.start", M.autostart)
|
||||
events.map("hyprland.start", M.autostart)
|
||||
|
||||
bind.map(M.binds)
|
||||
bind.map(M.binds)
|
||||
|
||||
hl.config(M.confs)
|
||||
hl.config(M.confs)
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user