Skip to content
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

nixos/hidpi: Reasonable defaults for high-density displays #88669

Merged
merged 3 commits into from Jul 22, 2020

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented May 23, 2020

Motivation for this change

This is a smaller subset of #87730
It does not contain any x11 settings yet.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Member

@emilazy emilazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me in general, I'd be happy to enable this on my systems.

nixos/modules/hardware/video/high-dpi.nix Outdated Show resolved Hide resolved
nixos/modules/hardware/video/high-dpi.nix Outdated Show resolved Hide resolved
@Mic92 Mic92 force-pushed the hidpi branch 2 times, most recently from 94f8e86 to 2c0c134 Compare May 24, 2020 07:41
@Mic92 Mic92 changed the title nixos/high-dpi: Reasonable defaults for high-density displays nixos/hidpi: Reasonable defaults for high-density displays May 24, 2020
@Mic92
Copy link
Member Author

Mic92 commented May 24, 2020

Switched to ter-132n.psf.gz. Spleen would be also a reasonable alternative however we also use terminus in our default setup. That's I want to keep it consistent when HiDPI displays are used. If has good reason to use a different console font, please propose so in a different PR.

push @attrs, "# High-DPI console";
push @attrs, 'console.font = lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz";';
push @attrs, "# high-resolution display";
push @attrs, 'hardware.video.hidpi.enable = lib.mkDefault true;';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure having this is the best heuristic for HiDPI - what if the monitor is just really large? In general I don't think it's correct to determine HiDPI from resolution

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO it's a reasonable assumption that if we have lots of pixels it's okay to make stuff bigger, even if it's not correct in absolutely all cases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have a better method. i.e. a simple way to decode edid, we can change it.
Notice that this PR does not change the way hidpi is detected.

@@ -42,7 +42,7 @@
</para>

<para>
If the text is too small to be legible, try <command>setfont ter-132n</command>
If the text is too small to be legible, try <command>setfont ter-v32n</command>
Copy link
Member Author

@Mic92 Mic92 May 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just detect larger tty's in the installer and scale up automatically during boot?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway. This should not be part of this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an existing issue/PR for making nixos-minimal iso autodetect hidpi and choose a larger font?

@Mic92
Copy link
Member Author

Mic92 commented May 25, 2020

Any other concerns?

@bbigras
Copy link
Contributor

bbigras commented Jul 9, 2020

friendly ping to everyone.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/224

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants