diff --git a/settings/hyprland.nix b/settings/hyprland.nix index 0f118ea..f26c073 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -94,7 +94,21 @@ in polkit_gnome ]; - home-manager.users.fred = { config, lib, pkgs, inputs, ... }: { + home-manager.users.fred = { config, lib, pkgs, inputs, ... }: + let + c = config.lib.stylix.colors; + rgb = hex: "rgb(${hex})"; + rgba = hex: a: "rgba(${hex}${a})"; + in { + # Stylix's Hyprland target injects settings.{general,decoration,group,misc} + # as top-level keys, which render as hl.general()/hl.decoration()/… in Lua + # mode — functions that don't exist. Disable it and absorb the colours + # into settings.config below. + stylix.targets.hyprland.enable = false; + + # Hyprpaper was previously started by stylix's Hyprland target; keep it. + services.hyprpaper.enable = true; + wayland.windowManager.hyprland = { enable = true; configType = "lua"; @@ -111,6 +125,8 @@ in border_size = 2; layout = "dwindle"; resize_on_border = true; + "col.active_border" = rgb c.base0D; + "col.inactive_border" = rgb c.base03; }; decoration = { @@ -118,6 +134,18 @@ in blur = { enabled = true; }; + shadow.color = rgba c.base00 "99"; + }; + + group = { + "col.border_active" = rgb c.base0D; + "col.border_inactive" = rgb c.base03; + "col.border_locked_active" = rgb c.base0C; + groupbar = { + text_color = rgb c.base05; + "col.active" = rgb c.base0D; + "col.inactive" = rgb c.base03; + }; }; render = { @@ -157,6 +185,7 @@ in # show as urgent in the bar instead. focus_on_activate = false; vrr = 2; + background_color = rgb c.base00; }; # vfr moved from misc: to debug: in 0.55.0 @@ -560,6 +589,14 @@ in #battery.critical { color: @base08; } ''; }; + + # The old hyprlang hyprland.conf (with `# autogenerated = 1`) is not + # managed by HM after switching to configType = "lua", so Hyprland still + # finds it and shows the "autogenerated config" banner. Remove it once on + # every activation so it can never linger. + home.activation.removeOldHyprlandConf = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + rm -f "${config.xdg.configHome}/hypr/hyprland.conf" + ''; }; }; }