hl: make custom stuff optional

This commit is contained in:
end-4
2026-05-14 12:35:29 +02:00
parent 798d35a538
commit 28ba8a4f43
4 changed files with 38 additions and 17 deletions
+28 -14
View File
@@ -1,26 +1,40 @@
-- This file sources other files in `hyprland` and `custom` folders -- This file sources other files in `hyprland` and `custom` folders
-- You wanna add your stuff in files in `custom` -- You wanna add your stuff in files in `custom`
-- Internal stuff --
require("hyprland.lib")
require("hyprland.services")
-- Environment variables -- -- Environment variables --
require("hyprland/env") require("hyprland.env")
require("custom/env") if is_file_exists(HOME .. "/.config/hypr/custom/env.lua") then
require("custom.env")
end
-- Defaults -- -- Default configurations --
require("hyprland/execs") require("hyprland.execs")
require("hyprland/general") require("hyprland.general")
require("hyprland/rules") require("hyprland.rules")
require("hyprland/colors") require("hyprland.colors")
require("hyprland/keybinds") require("hyprland.keybinds")
-- Custom -- -- Custom configurations --
require("custom/execs") if is_file_exists(HOME .. "/.config/hypr/custom/execs.lua") then
require("custom/general") require("custom.execs")
require("custom/rules") end
require("custom/keybinds") if is_file_exists(HOME .. "/.config/hypr/custom/general.lua") then
require("custom.general")
end
if is_file_exists(HOME .. "/.config/hypr/custom/rules.lua") then
require("custom.rules")
end
if is_file_exists(HOME .. "/.config/hypr/custom/keybinds.lua") then
require("custom.keybinds")
end
-- nwg-displays support: re-add the files if it updates later -- nwg-displays support: re-add the files if it updates later
-- require("workspaces") -- require("workspaces")
-- require("monitors") -- require("monitors")
-- Shell overrides -- -- Shell overrides --
require("hyprland/shellOverrides/main") require("hyprland.shellOverrides.main")
+6 -1
View File
@@ -1,6 +1,11 @@
require("hyprland.lib") require("hyprland.lib")
require("hyprland.variables") require("hyprland.variables")
require("custom.variables") if is_file_exists(HOME .. "/.config/hypr/custom/variables.lua") then
require("custom.variables")
end
if is_file_exists(HOME .. "/.config/hypr/custom/keybinds.lua") then
require("custom.keybinds")
end
local qsScripts = "$HOME/.config/quickshell/$qsConfig/scripts" local qsScripts = "$HOME/.config/quickshell/$qsConfig/scripts"
local hyprScripts = "$HOME/.config/hypr/hyprland/scripts" local hyprScripts = "$HOME/.config/hypr/hyprland/scripts"
+2
View File
@@ -1,3 +1,5 @@
HOME = os.getenv("HOME")
function is_file_exists(name) function is_file_exists(name)
local f = io.open(name, "r") local f = io.open(name, "r")
if f ~= nil then if f ~= nil then
@@ -23,7 +23,7 @@ hl.on("hyprland.start", function()
end end
if createdFiles > 0 then if createdFiles > 0 then
hl.exec_cmd("notify-send 'Hyprland config' 'Created " .. createdFiles .. " custom Hyprland config files in " .. baseCustomDir .. "' -a 'Hyprland'") -- hl.exec_cmd("notify-send 'Hyprland config' 'Created " .. createdFiles .. " custom Hyprland config files in " .. baseCustomDir .. "' -a 'Hyprland'")
hl.exec_cmd("hyprctl reload") -- hl.exec_cmd("hyprctl reload")
end end
end) end)