Files
dotfiles/config/hypr/hyprland.lua
T

66 lines
1.6 KiB
Lua

-- Determine current platform
--- Trim a string
---@param s string the string to process
---@return string
local function trim_string(s)
return s:match("^%s*(.*)"):match("(.-)%s*$")
end
local is_docked = false
local laptop_config = false
local read_platform = trim_string(io.popen("cat ~/.config/janishutz/platform"):read("a")) == "l"
local read_docked = trim_string(io.popen("cat ~/.config/janishutz/docked"):read("a")) == "y"
if read_platform then
laptop_config = true
end
if read_docked and laptop_config then
is_docked = true
end
hl.notification.create({
text = "Config for " .. (laptop_config and "laptop" or "desktop") .. " loaded",
timeout = 5000,
})
if #hl.get_monitors() <= 1 then
is_docked = false
end
-- Core
require("hyprland.colors")
require("hyprland.core.general")
require("hyprland.core.input")(laptop_config and not is_docked)
require("hyprland.core.group")
require("hyprland.core.misc")
require("hyprland.core.style")
-- Binds
require("hyprland.binds.main")
require("hyprland.binds.device")
require("hyprland.binds.groups")
require("hyprland.binds.launch")
require("hyprland.binds.notifications")
require("hyprland.binds.screenshot")
require("hyprland.binds.window")
require("hyprland.binds.workspace")
-- Window rules
require("hyprland.windowrules.floating")
require("hyprland.windowrules.idle")
require("hyprland.windowrules.tags")
require("hyprland.windowrules.workspaces")
-- Workspace rules
require("hyprland.workspacerules.main")(laptop_config, is_docked)
-- Monitors
require("hyprland.monitors")(laptop_config, is_docked)
-- Execs
require("hyprland.execs")(laptop_config)
hl.device({
name = "pnp0c50:00-093a:0255-touchpad",
enabled = true,
})