programs/hyprland: disable Unknown-1 ghost monitor, move env variables to environment.d, add nvidia env variables

This commit is contained in:
Anthony Rodriguez 2025-01-28 19:52:19 +01:00
parent d0242089e2
commit a9a07fea6d
Signed by: nezia
SSH key fingerprint: SHA256:Ihfpl0rUpqDevYqnzSR34OYfVLbDNkBiUjs3CpX4ykA

View file

@ -7,7 +7,7 @@
... ...
}: let }: let
inherit (builtins) toString; inherit (builtins) toString;
inherit (lib) mkIf; inherit (lib) mkIf optionalAttrs optionalString;
inherit (lib'.generators) toHyprConf; inherit (lib'.generators) toHyprConf;
inherit (config.local.systemVars) username; inherit (config.local.systemVars) username;
@ -63,104 +63,118 @@ in {
inputs.hyprwm-contrib.packages.${pkgs.system}.grimblast inputs.hyprwm-contrib.packages.${pkgs.system}.grimblast
gnomeControlCenter gnomeControlCenter
]; ];
files.".config/hypr/hyprland.conf".text = toHyprConf { files = {
attrs = ".config/hypr/hyprland.conf".text = toHyprConf {
{ attrs =
xwayland = { {
force_zero_scaling = true; xwayland = {
}; force_zero_scaling = true;
env = [
"GDK_SCALE,1"
];
cursor = {
no_hardware_cursors = 1;
};
monitor = [
"eDP-1, preferred, auto, 1.33"
];
workspace = [
"special:terminal, on-created-empty:foot"
"special:mixer_gui, on-created-empty:pavucontrol"
"special:file_manager_gui, on-created-empty:nautilus"
"special:file_manager_tui, on-created-empty:foot -- yazi"
];
windowrulev2 = [
# fixes fullscreen windows (mostly games)
"stayfocused, initialtitle:^()$, initialclass:^(steam)$"
"minsize 1 1, initialtitle:^()$, initialclass:^(steam)$"
"maximize, initialtitle:^(\S+)$, initialclass:^(steamwebhelper)$"
"immediate, initialclass:^(steam_app_)(.*)$"
"fullscreen, initialclass:^(steam_app_)(.*)$"
# inhibit idle on every fullscreen app except games
"idleinhibit always, fullscreen:1,!initialclass:^(steam_app_)(.*)$"
];
render = {
explicit_sync = 1;
explicit_sync_kms = 1;
expand_undersized_textures = false;
};
bezier = "overshot, 0.05, 0.9, 0.1, 1.1";
animations = {
enabled = true;
animation = [
"windows, 1, 5, overshot"
"windowsOut, 1, 5, default, popin 80%"
"windowsMove, 1, 5, default, popin 80%"
"fade, 1, 5, default"
"border, 1, 5, default"
"borderangle, 0, 8, default"
"workspaces, 0"
"specialWorkspace, 0"
];
};
input = {
kb_options = "compose:ralt";
touchpad = {
natural_scroll = true;
scroll_factor = 0.8;
tap-to-click = true;
clickfinger_behavior = true;
}; };
};
gestures = { env = [
workspace_swipe = true; ];
workspace_swipe_direction_lock = false;
workspace_swipe_cancel_ratio = 0.15;
};
misc = { cursor = {
force_default_wallpaper = 0; no_hardware_cursors = 1;
disable_hyprland_logo = true; };
middle_click_paste = false;
}; monitor = [
} "eDP-1, preferred, auto, 1.33"
// lib.optionalAttrs styleCfg.enable { "Unknown-1,disabled"
env = [ ];
"HYPRCURSOR_THEME,${styleCfg.cursorTheme.name}" workspace = [
"HYPRCURSOR_SIZE,${toString styleCfg.cursorTheme.size}" "special:terminal, on-created-empty:foot"
"XCURSOR_SIZE,${toString styleCfg.cursorTheme.size}" "special:mixer_gui, on-created-empty:pavucontrol"
]; "special:file_manager_gui, on-created-empty:nautilus"
general = { "special:file_manager_tui, on-created-empty:foot -- yazi"
border_size = 4; ];
"col.active_border" = "rgb(${lib.removePrefix "#" styleCfg.scheme.palette.base0E})";
}; windowrulev2 = [
decoration = { # fixes fullscreen windows (mostly games)
rounding = 10; "stayfocused, initialtitle:^()$, initialclass:^(steam)$"
blur.enabled = true; "minsize 1 1, initialtitle:^()$, initialclass:^(steam)$"
}; "maximize, initialtitle:^(\S+)$, initialclass:^(steamwebhelper)$"
}
// import ./binds.nix lib; "immediate, initialclass:^(steam_app_)(.*)$"
"fullscreen, initialclass:^(steam_app_)(.*)$"
# inhibit idle on every fullscreen app except games
"idleinhibit always, fullscreen:1,!initialclass:^(steam_app_)(.*)$"
];
render = {
explicit_sync = 1;
explicit_sync_kms = 1;
expand_undersized_textures = false;
};
bezier = "overshot, 0.05, 0.9, 0.1, 1.1";
animations = {
enabled = true;
animation = [
"windows, 1, 5, overshot"
"windowsOut, 1, 5, default, popin 80%"
"windowsMove, 1, 5, default, popin 80%"
"fade, 1, 5, default"
"border, 1, 5, default"
"borderangle, 0, 8, default"
"workspaces, 0"
"specialWorkspace, 0"
];
};
input = {
kb_options = "compose:ralt";
touchpad = {
natural_scroll = true;
scroll_factor = 0.8;
tap-to-click = true;
clickfinger_behavior = true;
};
};
gestures = {
workspace_swipe = true;
workspace_swipe_direction_lock = false;
workspace_swipe_cancel_ratio = 0.15;
};
misc = {
force_default_wallpaper = 0;
disable_hyprland_logo = true;
middle_click_paste = false;
};
}
// optionalAttrs styleCfg.enable {
general = {
border_size = 4;
"col.active_border" = "rgb(${lib.removePrefix "#" styleCfg.scheme.palette.base0E})";
};
decoration = {
rounding = 10;
blur.enabled = true;
};
}
// import ./binds.nix lib;
};
".config/environment.d/${config.local.homeVars.userEnvFile}.conf".text =
''
GDK_SCALE="1"
''
+ optionalString styleCfg.enable ''
HYPRCURSOR_THEME="${styleCfg.cursorTheme.name}"
HYPRCURSOR_SIZE="${toString styleCfg.cursorTheme.size}"
XCURSOR_SIZE="${toString styleCfg.cursorTheme.size}"
''
+ optionalString config.local.modules.nvidia.enable ''
LIBVA_DRIVER_NAME="nvidia"
__GLX_VENDOR_LIBRARY_NAME="nvidia"
XDG_SESSION_TYPE="wayland"
GBM_BACKEND="nvidia-drm"
'';
}; };
}; };
}; };