mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Extract commonality
This commit is contained in:
@@ -1,15 +1,8 @@
|
||||
local paths = require("default.hypr.paths")
|
||||
|
||||
local function require_file_if_exists(path, module)
|
||||
local file = io.open(path, "r")
|
||||
if file then
|
||||
file:close()
|
||||
require(module)
|
||||
end
|
||||
end
|
||||
local require_optional = require("default.hypr.require_optional")
|
||||
|
||||
-- GUM environment variables for styling purposes.
|
||||
require_file_if_exists(paths.config_home .. "/omarchy/current/theme/gum_env.lua", "omarchy.current.theme.gum_env")
|
||||
require_optional.module("omarchy.current.theme.gum_env")
|
||||
|
||||
-- Cursor size.
|
||||
hl.env("XCURSOR_SIZE", "24")
|
||||
|
||||
@@ -14,11 +14,4 @@ require("default.hypr.input")
|
||||
require("default.hypr.windows")
|
||||
|
||||
-- Current theme overrides.
|
||||
do
|
||||
local paths = require("default.hypr.paths")
|
||||
local theme = io.open(paths.config_home .. "/omarchy/current/theme/hyprland.lua", "r")
|
||||
if theme then
|
||||
theme:close()
|
||||
require("omarchy.current.theme.hyprland")
|
||||
end
|
||||
end
|
||||
require("default.hypr.require_optional").module("omarchy.current.theme.hyprland")
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
-- Require a module only when it can be found on package.path.
|
||||
-- Errors inside existing modules still surface normally.
|
||||
|
||||
local M = {}
|
||||
|
||||
function M.module(module)
|
||||
if package.searchpath(module, package.path) then
|
||||
return require(module)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user