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

Add a shared HiDPI Configuration, use it. #157

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions common/pc/display/hidpi.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ pkgs, lib, ... }: {
console.font = lib.mkDefault
"${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz";

# Needed when doing cryptsetup
console.earlySetup = lib.mkDefault true;
boot.loader.systemd-boot.consoleMode = lib.mkDefault "max";
Comment on lines +2 to +7
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
console.font = lib.mkDefault
"${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz";
# Needed when doing cryptsetup
console.earlySetup = lib.mkDefault true;
boot.loader.systemd-boot.consoleMode = lib.mkDefault "max";
hardware.video.hidpi.enable = true;


services.xserver.dpi = lib.mkDefault 196;
fonts.fontconfig.dpi = lib.mkDefault 196;
Comment on lines +9 to +10
Copy link
Member

Choose a reason for hiding this comment

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

This is what I currently:

Suggested change
services.xserver.dpi = lib.mkDefault 196;
fonts.fontconfig.dpi = lib.mkDefault 196;
services.xserver.displayManager.setupCommands = ''
${pkgs.xlibs.xrandr}/bin/xrandr --dpi eDP-1
'';

It simply sets the dpi of my 4k screen as the dpi of x11. Not sure how to make the eDP-1 part more general.

environment.variables = lib.mkDefault {
GDK_SCALE = "2";
GDK_DPI_SCALE = "0.5";
_JAVA_OPTIONS = "-Dsun.java2d.uiScale=2";
Copy link
Member

Choose a reason for hiding this comment

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

I think those environment variables might brake wayland. We cannot just check if x11 is enabled since wayland will also likely enable x11 for xwayland.


};
}
1 change: 1 addition & 0 deletions lenovo/thinkpad/x1-extreme/gen2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ with lib;
{
imports = [
../.
../../../../common/pc/display/hidpi.nix
];

# Fixes an issue with incorrect battery reporting. See
Expand Down