Files
dotfiles/hypr/.config/hypr/hyprland.lua
T

78 lines
2.0 KiB
Lua

local config_home = os.getenv("XDG_CONFIG_HOME") or os.getenv("HOME") .. "/.config"
local fid_env = io.open(config_home .. "/hypr/env.lua")
local env = {}
if fid_env then
env = require("env")
else
env = require("env_example")
end
if env.shell ~= "noctalia" and env.shell ~= "caelestia" then
error("Unsupported shell '" .. tostring(env.shell) .. "' in ~/.config/hypr/env.lua; choose 'noctalia' or 'caelestia'")
end
hl.exec_cmd("bash ~/.config/hypr/env.sh")
-- ###############
-- ## MONITORS ###
-- ###############
-- load default monitor config
require("modules.monitor_setup_default")
-- unscale XWayland
hl.config({
xwayland = {
force_zero_scaling = true,
},
})
-- ##################
-- ## MY PROGRAMS ###
-- ##################
hl.on("hyprland.start", function()
-- start selected shell
if env.shell == "caelestia" then
hl.exec_cmd("caelestia shell -d")
else -- default: "noctalia"
hl.exec_cmd("noctalia &")
end
-- activate hypridle when not using Caelestia (has its own idle-ing mechnism)
if env.shell ~= "caelestia" then
hl.exec_cmd("hypridle &")
end
hl.exec_cmd("sh ~/.config/hypr/scripts/portal-host-override.sh")
hl.exec_cmd("sh ~/.config/hypr/scripts/ensure-mime-defaults.sh")
end)
require("modules.environment_variables")
require("modules.look_and_feel")
require("modules.input")
require("modules.keybinds")
require("modules.windows_and_workspaces")
-- HyprMod managed settings
local fid_gui = io.open(config_home .. "/hypr/hyprland-buntes-monster-gui.lua")
if fid_gui then
fid_gui:close()
require("hyprland-buntes-monster-gui")
end
-- For Noctalia Color templates. Noctalia-only: under Caelestia this would
-- otherwise push Noctalia's Catppuccin border colors into the compositor.
if env.shell == "noctalia" then
require("noctalia").apply_theme()
end
-- HyprMod managed settings
local fid_gui2 = io.open(config_home .. "/hypr/hyprland-gui.lua")
if fid_gui2 then
fid_gui2:close()
require("hyprland-gui")
end