diff --git a/dotfiles/config/hypr/hyprland/settings.lua b/dotfiles/config/hypr/hyprland/settings.lua index 4482ac4e..25e06be0 100644 --- a/dotfiles/config/hypr/hyprland/settings.lua +++ b/dotfiles/config/hypr/hyprland/settings.lua @@ -106,8 +106,8 @@ function M.setup(ctx) hl.plugin.load("/run/current-system/sw/lib/hyprglass.so") end - hl.env("XCURSOR_SIZE", "24") - hl.env("HYPRCURSOR_SIZE", "24") + hl.env("XCURSOR_SIZE", tostring(hyprland_cursor_size)) + hl.env("HYPRCURSOR_SIZE", tostring(hyprland_cursor_size)) hl.env("QT_QPA_PLATFORMTHEME", "qt5ct") hl.env("HYPR_MAX_WORKSPACE", "9") @@ -128,8 +128,8 @@ function M.setup(ctx) persistent_warps = true, }, general = { - gaps_in = 5, - gaps_out = 10, + gaps_in = hyprland_gaps_enabled and 5 or 0, + gaps_out = hyprland_gaps_enabled and 10 or 0, border_size = 2, col = { active_border = { colors = { "rgba(3b82f6ee)", "rgba(33ccffee)" }, angle = 45 }, diff --git a/dotfiles/config/hypr/hyprland/state.lua b/dotfiles/config/hypr/hyprland/state.lua index 19f4dcf4..2a74c340 100644 --- a/dotfiles/config/hypr/hyprland/state.lua +++ b/dotfiles/config/hypr/hyprland/state.lua @@ -68,6 +68,8 @@ return { enable_hyprwobbly = true, enable_dynamic_cursors = true, enable_hyprglass = false, + hyprland_gaps_enabled = os.getenv("IMALISON_HYPRLAND_GAPS") ~= "0", + hyprland_cursor_size = tonumber(os.getenv("IMALISON_HYPRLAND_CURSOR_SIZE")) or 24, hypr_visual_performance_mode = false, configure_nstack_plugin_from_lua = false, workspace_layouts = {}, diff --git a/nixos/hyprland.nix b/nixos/hyprland.nix index 174a9728..0a5ea759 100644 --- a/nixos/hyprland.nix +++ b/nixos/hyprland.nix @@ -149,6 +149,11 @@ overrideAttrs = f: makeHyprlandLuaPackage (package.overrideAttrs f); }; hyprlandPackage = makeHyprlandLuaPackage baseHyprlandPackage; + hyprlandGapsEnabledString = + if config.myModules.hyprland.gaps.enable + then "1" + else "0"; + hyprlandCursorSizeString = toString config.myModules.hyprland.cursorSize; enableHyprglass = false; hyprglass = pkgs.callPackage ./packages/hyprglass { src = inputs.hyprglass; @@ -415,6 +420,13 @@ services.rumno.enable = true; + environment.sessionVariables = { + IMALISON_HYPRLAND_GAPS = hyprlandGapsEnabledString; + IMALISON_HYPRLAND_CURSOR_SIZE = hyprlandCursorSizeString; + XCURSOR_SIZE = hyprlandCursorSizeString; + HYPRCURSOR_SIZE = hyprlandCursorSizeString; + }; + home-manager.sharedModules = [ inputs.hyprscratch.homeModules.default ( @@ -470,6 +482,19 @@ settings = {}; }; + home.sessionVariables = { + IMALISON_HYPRLAND_GAPS = hyprlandGapsEnabledString; + IMALISON_HYPRLAND_CURSOR_SIZE = hyprlandCursorSizeString; + XCURSOR_SIZE = hyprlandCursorSizeString; + HYPRCURSOR_SIZE = hyprlandCursorSizeString; + }; + systemd.user.sessionVariables = { + IMALISON_HYPRLAND_GAPS = hyprlandGapsEnabledString; + IMALISON_HYPRLAND_CURSOR_SIZE = hyprlandCursorSizeString; + XCURSOR_SIZE = hyprlandCursorSizeString; + HYPRCURSOR_SIZE = hyprlandCursorSizeString; + }; + xdg.configFile."hyprscratch/config.conf" = lib.mkIf false { text = lib.hm.generators.toHyprconf { attrs = hyprscratchSettings; diff --git a/nixos/machines/jay-lenovo.nix b/nixos/machines/jay-lenovo.nix index 90ec79fc..780a0106 100644 --- a/nixos/machines/jay-lenovo.nix +++ b/nixos/machines/jay-lenovo.nix @@ -39,6 +39,8 @@ myModules.postgres.enable = true; myModules.kat.enable = true; + myModules.hyprland.gaps.enable = false; + myModules.hyprland.cursorSize = 20; networking.networkmanager.enable = true; services.libinput.enable = true; @@ -71,6 +73,13 @@ home-manager.sharedModules = [ { home.stateVersion = "23.05"; + gtk.font.size = lib.mkForce 9; + gtk.gtk3.extraConfig.gtk-cursor-theme-size = lib.mkForce 20; + dconf.settings."org/gnome/desktop/interface".text-scaling-factor = 0.9; + dconf.settings."org/gnome/desktop/interface".cursor-size = 20; + xdg.configFile."ghostty/config".text = lib.mkAfter '' + font-size = 11 + ''; } ]; } diff --git a/nixos/options.nix b/nixos/options.nix index 2bb7d15f..977be334 100644 --- a/nixos/options.nix +++ b/nixos/options.nix @@ -32,6 +32,18 @@ in { default = true; type = lib.types.bool; }; + + myModules.hyprland.gaps.enable = lib.mkOption { + default = true; + type = lib.types.bool; + description = "Whether Hyprland should use nonzero window gaps."; + }; + + myModules.hyprland.cursorSize = lib.mkOption { + default = 24; + type = lib.types.ints.positive; + description = "Cursor size exported to Hyprland and cursor-aware toolkits."; + }; }; config = {