New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add high-dpi module #87730
add high-dpi module #87730
Conversation
Extracted from NixOS/nixos-hardware#157 |
cc @gnidorah @colemickens can you give some feedback how this module would work on wayland? Right now I have only tested it on x11. |
boot.loader.systemd-boot.consoleMode = mkDefault "max"; | ||
|
||
services.xserver.dpi = mkDefault 196; | ||
fonts.fontconfig.dpi = mkDefault 196; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I assume that everything starting from here should be only set, if x11 is enabled, or will wayland not be bothered by it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mic92 Not bothered as I looked, and these should help XWayland programs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally X11 is enabled even for pure-Wayland configurations (NixOS conflates "graphical environment" with "Xorg enabled" currently), so it's impossible to make configurations conditional on not using Wayland.
I don't think overriding X11/fontconfig default DPI is a good idea. Lots of things act awkwardly or break with dpi ≠ 96 and, e.g. sway and GNOME kind of expect X11/fontconfig settings to be unscaled for Wayland HiDPI. Similarly, hardcoding The console font Is there a reason to set (Basically the common theme here is that there's not a lot you can usefully statically set to get HiDPI configs working. But I think having a profile to get console/bootloader fonts readable is a good idea, especially if |
I haven't found a good way to enable HiDPI without setting the That said, I think we should have a clear warning in the description that this is a collection of hacks, and not really an ideal way to set DPI. In addition to the issues @emilazy describes, I think this messes up external monitors. At least it will use 196 dpi regardless of individual DPIs. |
That's because the X11 DPI setting is basically deprecated and the server just sets it to 96 no matter what, precisely because it wasn't a great solution for HiDPI. It can be useful as a hack for toolkits that don't support native HiDPI scaling, but those are increasingly rare these days, and it generally makes behaviour worse for the majority of applications using toolkits that do understand HiDPI. If you're running without a desktop environment that manages the scaling settings for you, then your best bet is to set Edit: Sorry, missed your mention of Plasma... not finding any clear-cut information online, but I think it's worth twiddling with the |
So it looks like setting |
If they set a different scale by changing GDK_SCALE/_JAVA_OPTIONS it gets overriden, no? How to make it work without GDK_SCALE?
I used this font because it does not conflict with our nixos-generate-config. |
Maybe someone else can take this over. I just picked some settings, that worked for me. |
These settings are also used in the wiki: https://nixos.wiki/wiki/Xorg |
Here is a subset of the changes: #87730 |
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)