From 063cc0e2907254ffce2e76062f4ae62bc3bc3f64 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Mon, 12 Feb 2024 17:19:44 +0100 Subject: [PATCH] fractional scaling --- modules/gnome-fractional-scaling.nix | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/modules/gnome-fractional-scaling.nix b/modules/gnome-fractional-scaling.nix index 6d2e931..105fc4c 100644 --- a/modules/gnome-fractional-scaling.nix +++ b/modules/gnome-fractional-scaling.nix @@ -8,6 +8,15 @@ in # 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 monitor’s 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. + # 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 + programs.dconf.enable = true; # Overlays. @@ -60,15 +69,13 @@ in home-manager.users.yoda = { osConfig, config, pkgs, ... }: { dconf.settings = { "org/gnome/mutter" = { - experimental-features = [ - ( - if (osConfig.services.xserver.displayManager.gdm.wayland) - # Wayland fractional scaling - then "scale-monitor-framebuffer" - # X11 fractional scaling - else "x11-randr-fractional-scaling" - ) - ]; + experimental-features = ( + if (osConfig.services.xserver.displayManager.gdm.wayland) + # Wayland + then ["scale-monitor-framebuffer"] + # X11 + else ["scale-monitor-framebuffer" "x11-randr-fractional-scaling"] + ); }; }; };