129 lines
8.2 KiB
Lua
129 lines
8.2 KiB
Lua
-- gui package — the dots Hyprland layer, ported from the hyprlang chain
|
|
-- (hyde.conf / userprefs.conf / keybindings.conf / windowrules.conf) to
|
|
-- HyDE 26.x's Lua config. Loaded by ~/.local/share/hypr/hyde.lua second-to-last
|
|
-- (after every HyDE module, before lua_state.workflows), so plain assignments
|
|
-- here override HyDE's defaults. HyDE never overwrites this file.
|
|
--
|
|
-- The rules and keybinds sections live in ./dots_rules.lua and
|
|
-- ./dots_binds.lua, required in place below. Host-specific config (monitors,
|
|
-- workspace pins, gaps/rounding, gpu extras) lives in ./host.lua, loaded at
|
|
-- the bottom — same layering the hyprlang chain had with
|
|
-- `source = ./host.conf`.
|
|
|
|
-- Bootstrap: Hyprland prefers hyprland.lua as the entry point when started
|
|
-- without a config; without this block that path yields a bare cursor. hyde.lua
|
|
-- sets `hyde` on its first line, so this runs only when HyDE has not loaded.
|
|
-- The `return` matters: dofile(hyde.lua) re-enters this file through
|
|
-- check_require("hyprland"), so by the time dofile returns the body below has
|
|
-- already run once — falling through would register everything twice.
|
|
if not hyde then
|
|
local share = os.getenv("XDG_DATA_HOME") or (os.getenv("HOME") .. "/.local/share")
|
|
local entry = share .. "/hypr/hyde.lua"
|
|
local handle = io.open(entry, "r")
|
|
if not handle then
|
|
error(
|
|
"HyDE is not installed at " .. entry .. ". Run HyDE's install.sh -r, or point Hyprland at your own config."
|
|
)
|
|
end
|
|
handle:close()
|
|
dofile(entry)
|
|
return
|
|
end
|
|
|
|
local hc = hyde.config
|
|
local home = os.getenv("HOME") or ""
|
|
|
|
-- ── Apps ─────────────────────────────────────────────────────────────────────
|
|
-- Named directly (not hyde-shell open --fall …) for the same reason hyde.conf
|
|
-- did: skip the wrapper, match the xdg defaults. The assignments cover lazy
|
|
-- readers of hc.app.*, but key_binds.lua already baked the defaults into its
|
|
-- Super+B/E dispatchers at bind time — hence the explicit rebinds in
|
|
-- dots_binds.lua.
|
|
hc.app.browser = "zen-browser"
|
|
hc.app.explorer = "dolphin"
|
|
|
|
-- ── Startup ──────────────────────────────────────────────────────────────────
|
|
-- One knob suppresses HyDE's plain waybar AND launches the cava rig (was
|
|
-- $start.BAR= + a userprefs exec-once). start_up.lua captures hc.start by
|
|
-- reference and the hyprland.start event fires after this file loads, so the
|
|
-- override lands in time. `wbar` (gui/.local/bin) runs the rig as the
|
|
-- dots-waybar.service transient unit with Restart=always: waybar 0.15.0 dies on
|
|
-- every DP-2 link drop/return, and as a plain scope nothing relaunched it.
|
|
-- Absolute path: the exec env's PATH is not guaranteed to hold ~/.local/bin.
|
|
hc.start.bar = home .. "/.local/bin/wbar start"
|
|
-- Not part of the legacy session — the Lua defaults would newly launch these
|
|
-- (both binaries are installed). hyprsunset would visibly tint the screen.
|
|
-- Delete a line to adopt the HyDE default.
|
|
hc.start.blue_light_filter_daemon = ""
|
|
hc.start.clipboard_persist = ""
|
|
-- nm-applet --indicator is already the Lua default (kept deliberately: the
|
|
-- tray icon is the one place with a quick connect/disconnect menu).
|
|
|
|
-- ── UI / icon theme ──────────────────────────────────────────────────────────
|
|
-- dots-icons = repo-tracked overlay theme (gui/.local/share/icons/dots-icons)
|
|
-- that inherits Tela-circle-dracula and swaps the tray/status icons for the
|
|
-- monochrome panel set — without it, waybar on a fractionally-scaled monitor
|
|
-- gets the colored-circle variants (the blue nm-applet blob).
|
|
hc.ui.icon_theme = "dots-icons"
|
|
-- The theme-switch pipeline regenerates lua_state/ui.lua from the theme's
|
|
-- hypr.theme and writes THAT to dconf (color/hypr.sh -> color/dconf.lua), so
|
|
-- the assignment above is not enough on its own. Top-level code re-runs on
|
|
-- every `hyprctl reload`, and both theme-switch paths end in a reload, so this
|
|
-- write lands last — the Lua-mode equivalent of the legacy $exec.dConf.
|
|
-- Upstream-sanctioned alternative if this ever races: add
|
|
-- [hyprland]\n icon_theme = "dots-icons"
|
|
-- to ~/.config/hyde/config.toml (state/hyde/hyprland.conf then overrides the
|
|
-- theme vars in theme.switch.sh:151).
|
|
hl.exec_cmd([[dconf write /org/gnome/desktop/interface/icon-theme "'dots-icons'"]])
|
|
|
|
-- ── Env (was userprefs.conf) ─────────────────────────────────────────────────
|
|
hl.env("SSH_AUTH_SOCK", (os.getenv("XDG_RUNTIME_DIR") or "") .. "/ssh-agent.socket")
|
|
hl.env("ELECTRON_OZONE_PLATFORM_HINT", "x11") -- disable after hyprland fixes electron flickering
|
|
|
|
-- ── Layer + window rules (dots_rules.lua) ────────────────────────────────────
|
|
-- Plain require, not check_require: stow --no-folding links new files one by
|
|
-- one, so a host that pulled without re-running install.sh fails loudly in
|
|
-- `hyprctl configerrors` instead of booting silently without its rules/binds.
|
|
-- The dots_ prefix matters: hyde.lua searches HyDE's own lua/ before
|
|
-- ~/.config/hypr, so a bare window_rules / key_binds would load HyDE's module.
|
|
require("dots_rules")
|
|
|
|
-- ── Animations ───────────────────────────────────────────────────────────────
|
|
-- The legacy chain ran $ANIMATION=theme — the hyprdots set from the theme's
|
|
-- animations.dcol. The Lua chain cannot inherit it: hyq's hyprland-lua.json
|
|
-- schema dumps decoration/borders into lua_state/hypr_theme.lua but NOT the
|
|
-- animations block (LUA-PORT.md risk 6, confirmed live), so without this the
|
|
-- session falls back to Hyprland's slower built-in defaults. Ported verbatim
|
|
-- from the generated ~/.config/hypr/animations/theme.conf.
|
|
-- Conditional so `hyde-shell animations --select` still works: a selector-
|
|
-- chosen lua_state/animations.lua loads earlier (dynamic.lua) and this block
|
|
-- steps aside for it.
|
|
local anim_state = (os.getenv("XDG_STATE_HOME") or home .. "/.local/state") .. "/hyde/lua_state/animations.lua"
|
|
local anim_f = io.open(anim_state, "r")
|
|
if anim_f then
|
|
anim_f:close()
|
|
else
|
|
hl.curve("wind", { type = "bezier", points = { { 0.05, 0.9 }, { 0.1, 1.05 } } })
|
|
hl.curve("winIn", { type = "bezier", points = { { 0.1, 1.1 }, { 0.1, 1.1 } } })
|
|
hl.curve("winOut", { type = "bezier", points = { { 0.3, -0.3 }, { 0, 1 } } })
|
|
hl.curve("liner", { type = "bezier", points = { { 1, 1 }, { 1, 1 } } })
|
|
hl.animation({ leaf = "windows", enabled = true, speed = 6, bezier = "wind", style = "slide" })
|
|
hl.animation({ leaf = "windowsIn", enabled = true, speed = 6, bezier = "winIn", style = "slide" })
|
|
hl.animation({ leaf = "windowsOut", enabled = true, speed = 5, bezier = "winOut", style = "slide" })
|
|
hl.animation({ leaf = "windowsMove", enabled = true, speed = 5, bezier = "wind", style = "slide" })
|
|
hl.animation({ leaf = "border", enabled = true, speed = 1, bezier = "liner" })
|
|
hl.animation({ leaf = "borderangle", enabled = true, speed = 30, bezier = "liner", style = "once" })
|
|
hl.animation({ leaf = "fade", enabled = true, speed = 10, bezier = "default" })
|
|
hl.animation({ leaf = "workspaces", enabled = true, speed = 5, bezier = "wind" })
|
|
end
|
|
|
|
-- ── Keybinds (dots_binds.lua) ────────────────────────────────────────────────
|
|
-- After the hc.app.* overrides above: the launcher binds read them.
|
|
require("dots_binds")
|
|
|
|
-- ── Host layer ───────────────────────────────────────────────────────────────
|
|
-- Resolves via hyde.lua's package.path (~/.config/hypr/?.lua); each host
|
|
-- overlay stows its own host.lua (wm/, lw/). check_require is HyDE's
|
|
-- missing-tolerant require — a host without one just skips it.
|
|
check_require("host")
|