hyprland: expose density and cursor tuning

This commit is contained in:
2026-06-01 00:10:19 -07:00
parent 964ed7584e
commit 495a5cbca2
5 changed files with 52 additions and 4 deletions

View File

@@ -106,8 +106,8 @@ function M.setup(ctx)
hl.plugin.load("/run/current-system/sw/lib/hyprglass.so") hl.plugin.load("/run/current-system/sw/lib/hyprglass.so")
end end
hl.env("XCURSOR_SIZE", "24") hl.env("XCURSOR_SIZE", tostring(hyprland_cursor_size))
hl.env("HYPRCURSOR_SIZE", "24") hl.env("HYPRCURSOR_SIZE", tostring(hyprland_cursor_size))
hl.env("QT_QPA_PLATFORMTHEME", "qt5ct") hl.env("QT_QPA_PLATFORMTHEME", "qt5ct")
hl.env("HYPR_MAX_WORKSPACE", "9") hl.env("HYPR_MAX_WORKSPACE", "9")
@@ -128,8 +128,8 @@ function M.setup(ctx)
persistent_warps = true, persistent_warps = true,
}, },
general = { general = {
gaps_in = 5, gaps_in = hyprland_gaps_enabled and 5 or 0,
gaps_out = 10, gaps_out = hyprland_gaps_enabled and 10 or 0,
border_size = 2, border_size = 2,
col = { col = {
active_border = { colors = { "rgba(3b82f6ee)", "rgba(33ccffee)" }, angle = 45 }, active_border = { colors = { "rgba(3b82f6ee)", "rgba(33ccffee)" }, angle = 45 },

View File

@@ -68,6 +68,8 @@ return {
enable_hyprwobbly = true, enable_hyprwobbly = true,
enable_dynamic_cursors = true, enable_dynamic_cursors = true,
enable_hyprglass = false, 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, hypr_visual_performance_mode = false,
configure_nstack_plugin_from_lua = false, configure_nstack_plugin_from_lua = false,
workspace_layouts = {}, workspace_layouts = {},

View File

@@ -149,6 +149,11 @@
overrideAttrs = f: makeHyprlandLuaPackage (package.overrideAttrs f); overrideAttrs = f: makeHyprlandLuaPackage (package.overrideAttrs f);
}; };
hyprlandPackage = makeHyprlandLuaPackage baseHyprlandPackage; hyprlandPackage = makeHyprlandLuaPackage baseHyprlandPackage;
hyprlandGapsEnabledString =
if config.myModules.hyprland.gaps.enable
then "1"
else "0";
hyprlandCursorSizeString = toString config.myModules.hyprland.cursorSize;
enableHyprglass = false; enableHyprglass = false;
hyprglass = pkgs.callPackage ./packages/hyprglass { hyprglass = pkgs.callPackage ./packages/hyprglass {
src = inputs.hyprglass; src = inputs.hyprglass;
@@ -415,6 +420,13 @@
services.rumno.enable = true; services.rumno.enable = true;
environment.sessionVariables = {
IMALISON_HYPRLAND_GAPS = hyprlandGapsEnabledString;
IMALISON_HYPRLAND_CURSOR_SIZE = hyprlandCursorSizeString;
XCURSOR_SIZE = hyprlandCursorSizeString;
HYPRCURSOR_SIZE = hyprlandCursorSizeString;
};
home-manager.sharedModules = [ home-manager.sharedModules = [
inputs.hyprscratch.homeModules.default inputs.hyprscratch.homeModules.default
( (
@@ -470,6 +482,19 @@
settings = {}; 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 { xdg.configFile."hyprscratch/config.conf" = lib.mkIf false {
text = lib.hm.generators.toHyprconf { text = lib.hm.generators.toHyprconf {
attrs = hyprscratchSettings; attrs = hyprscratchSettings;

View File

@@ -39,6 +39,8 @@
myModules.postgres.enable = true; myModules.postgres.enable = true;
myModules.kat.enable = true; myModules.kat.enable = true;
myModules.hyprland.gaps.enable = false;
myModules.hyprland.cursorSize = 20;
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
services.libinput.enable = true; services.libinput.enable = true;
@@ -71,6 +73,13 @@
home-manager.sharedModules = [ home-manager.sharedModules = [
{ {
home.stateVersion = "23.05"; 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
'';
} }
]; ];
} }

View File

@@ -32,6 +32,18 @@ in {
default = true; default = true;
type = lib.types.bool; 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 = { config = {