nix-git/modules/gnome-fractional-scaling.nix

33 lines
1.4 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ config, pkgs, lib, ... }:
{
# https://wiki.archlinux.org/title/HiDPI#Wayland
# Results in blurry font in non-Wayland applications :/
# https://wiki.archlinux.org/title/HiDPI#Xorg
# https://devicetests.com/set-different-scaling-multi-monitors-gnome
# "scale-monitor-framebuffer": This allows GNOME to scale each monitors framebuffer independently, which is necessary for per-monitor scaling.
# "x11-randr-fractional-scaling": This allows fractional scaling, which gives you finer control over the scaling factor.
# TODO: Open issue. Fractional scaling can't be enabled with multiple monitors.
# TODO: X11 or Wayland or both?
# https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2076
# https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2365
# -> https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/2008355
assertions = [{
assertion = config.services.xserver.displayManager.gdm.wayland;
message = "Fractional scaling is only supported for Wayland. There is a patch for X11, but we no longer apply it in an overlay. See e.g. https://aur.archlinux.org/packages/mutter-x11-scaling";
}];
programs.dconf.enable = true;
home-manager.users.yoda = { osConfig, config, pkgs, ... }: {
dconf.settings = {
"org/gnome/mutter" = {
experimental-features = ["scale-monitor-framebuffer" "xwayland-native-scaling"];
};
};
};
}