diff --git a/hypr/hosts/example.lua b/hypr/hosts/example.lua index a5c4503..55456f9 100644 --- a/hypr/hosts/example.lua +++ b/hypr/hosts/example.lua @@ -1,7 +1,10 @@ --- example.lua - no-op host fallback (mirrors example.conf) +-- example.lua — TEMPLATE for a per-host config file (NOT loaded at runtime). -- --- Used by hyprland.lua when the machine's hostname does not match any --- hosts/.lua file. Keep this file empty (or add shared defaults). --- Create a file named after your host, e.g. hosts/MyHost.lua, to override --- host-specific settings. +-- Hyprland's Lua config only loads hosts/.lua matching the current +-- machine's hostname. If none matches, hyprland.lua simply uses its defaults. +-- This file is never required; it exists purely as a documented template. +-- +-- To add your own machine, copy this to hosts/.lua and fill it +-- in. The hostname lookup strips any domain suffix (e.g. "laptop.home" -> "laptop"). + return {} diff --git a/hypr/hyprland.lua b/hypr/hyprland.lua index 20a50d6..2fd3761 100644 --- a/hypr/hyprland.lua +++ b/hypr/hyprland.lua @@ -280,5 +280,6 @@ local hostname = (io.popen("hostname") or {}):read("*l") or "" hostname = hostname:gsub("%..*$", "") -- strip domain suffix local ok, err = pcall(require, "hosts." .. hostname) if not ok then - require("hosts.example") + -- No host file matches this machine; use the defaults already set above. + -- See hosts/example.lua for a template on adding your own host. end